[ros-diffs] [gedmurphy] 40298: fix wine's code a little better

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Mon Mar 30 21:28:40 CEST 2009


Author: gedmurphy
Date: Mon Mar 30 23:28:39 2009
New Revision: 40298

URL: http://svn.reactos.org/svn/reactos?rev=40298&view=rev
Log:
fix wine's code a little better

Modified:
    trunk/reactos/dll/win32/shell32/iconcache.c

Modified: trunk/reactos/dll/win32/shell32/iconcache.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/iconcache.c?rev=40298&r1=40297&r2=40298&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/iconcache.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/iconcache.c [iso-8859-1] Mon Mar 30 23:28:39 2009
@@ -438,6 +438,11 @@
                                 cx_small,
                                 cy_small,
                                 LR_SHARED | LR_DEFAULTCOLOR);
+        if (!hSm)
+        {
+            ERR("Failed to load IDI_SHELL_DOCUMENT icon!\n");
+            return FALSE;
+        }
     }
 
     ShellBigIconList = ImageList_Create(cx_large,
@@ -445,7 +450,7 @@
                                         ilMask,
                                         100,
                                         100);
-    if (!ShellSmallIconList)
+    if (!ShellBigIconList)
     {
         hLg = (HICON)LoadImageW(shell32_hInstance,
                                 MAKEINTRESOURCEW(IDI_SHELL_DOCUMENT),
@@ -453,16 +458,20 @@
                                 cx_large,
                                 cy_large,
                                 LR_SHARED | LR_DEFAULTCOLOR);
+        if (!hLg)
+        {
+            ERR("Failed to load IDI_SHELL_DOCUMENT icon!\n");
+            DestroyIcon(hSm);
+            return FALSE;
+        }
     }
 
-    if (!hSm || !hLg)
-    {
-      FIXME("Failed to load IDI_SHELL_DOCUMENT icon!\n");
-      return FALSE;
-    }
 
     SIC_IconAppend(swShell32Name, IDI_SHELL_DOCUMENT-1, hSm, hLg, 0);
     SIC_IconAppend(swShell32Name, -IDI_SHELL_DOCUMENT, hSm, hLg, 0);
+
+    DestroyIcon(hSm);
+    DestroyIcon(hLg);
 
     TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
 



More information about the Ros-diffs mailing list