6489447: Apply the more robust fix for 6449933 to dolphin and 6ux
authorrupashka
Tue, 07 Jul 2009 14:11:06 +0400
changeset 3242 928d499ce8b6
parent 3241 6fd229e009e7
child 3243 584da5a15e55
6489447: Apply the more robust fix for 6449933 to dolphin and 6ux Reviewed-by: malenkov
jdk/src/windows/native/sun/windows/ShellFolder2.cpp
--- a/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	Mon Jul 06 14:32:04 2009 +0400
+++ b/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	Tue Jul 07 14:11:06 2009 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -981,6 +981,15 @@
         hBitmap = (HBITMAP)LoadImage(libShell32,
                     IS_WINVISTA ? TEXT("IDB_TB_SH_DEF_16") : MAKEINTRESOURCE(216),
                     IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
+
+        if (hBitmap == NULL) {
+            // version of shell32.dll doesn't match OS version.
+            // So we either are in a Vista Compatibility Mode
+            // or shell32.dll was copied from OS of another version
+            hBitmap = (HBITMAP)LoadImage(libShell32,
+                    IS_WINVISTA ? MAKEINTRESOURCE(216) : TEXT("IDB_TB_SH_DEF_16"),
+                    IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
+        }
     }
     if (hBitmap == NULL) {
         libComCtl32 = LoadLibrary(TEXT("comctl32.dll"));