6860270: JVM crash is occuring when verifying whether Browse action is supported on WinVista 64 bit
authorart
Thu, 30 Sep 2010 21:06:53 +0400
changeset 6641 4a5fb08cce1c
parent 6640 5e889a82c906
child 6642 9d6f6dbb16a4
6860270: JVM crash is occuring when verifying whether Browse action is supported on WinVista 64 bit Reviewed-by: anthony, uta
jdk/src/windows/native/sun/windows/awt_Desktop.cpp
--- a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp	Thu Sep 30 14:50:36 2010 +0400
+++ b/jdk/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;