changeset 2915:8afd49c55619

6860270: JVM crash is occuring when verifying whether Browse action is supported on WinVista 64 bit Reviewed-by: anthony, uta
author art
date Thu, 30 Sep 2010 21:06:53 +0400
parents 3caf15616f46
children b0d1ef182650
files src/windows/native/sun/windows/awt_Desktop.cpp
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Desktop.cpp	Thu Sep 30 14:50:36 2010 +0400
+++ b/src/windows/native/sun/windows/awt_Desktop.cpp	Thu Sep 30 21:06:53 2010 +0400
@@ -59,15 +59,17 @@
                     FORMAT_MESSAGE_FROM_SYSTEM  |
                     FORMAT_MESSAGE_IGNORE_INSERTS,
                     NULL,
-                    GetLastError(),
+                    (int)retval,
                     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
                     (LPTSTR)&buffer,
                     0,
                     NULL );
 
-        jstring errmsg = JNU_NewStringPlatform(env, buffer, len);
-        LocalFree(buffer);
-        return errmsg;
+        if (buffer) {
+            jstring errmsg = JNU_NewStringPlatform(env, buffer);
+            LocalFree(buffer);
+            return errmsg;
+        }
     }
 
     return NULL;