Author: gedmurphy
Date: Thu May 26 22:01:05 2011
New Revision: 51940

URL: http://svn.reactos.org/svn/reactos?rev=51940&view=rev
Log:
[SHELL32_NEW]
- Merge 51729
Implement SHGetImageList
http://source.winehq.org/git/wine.git/commitdiff/9db87f13d3f0f9e07accc9b5e12dccd202b88156
Fixes explorer++ main window

Modified:
    branches/shell32_new-bringup/dll/win32/shell32/shellord.cpp

Modified: branches/shell32_new-bringup/dll/win32/shell32/shellord.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/shellord.cpp?rev=51940&r1=51939&r2=51940&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/shellord.cpp [iso-8859-1] 
(original)
+++ branches/shell32_new-bringup/dll/win32/shell32/shellord.cpp [iso-8859-1] 
Thu May 26 22:01:05 2011
@@ -50,6 +50,7 @@
 #include "shlwapi.h"
 #include "commdlg.h"
 #include "recyclebin.h"
+#include "commoncontrols.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 WINE_DECLARE_DEBUG_CHANNEL(pidl);
@@ -2254,10 +2255,40 @@
 {
 }
 
+/*************************************************************************
+ *              SHGetImageList (SHELL32.727)
+ *
+ * Returns a copy of a shell image list.
+ *
+ * NOTES
+ *   Windows XP features 4 sizes of image list, and Vista 5. Wine currently
+ *   only supports the traditional small and large image lists, so requests
+ *   for the others will currently fail.
+ */
 EXTERN_C HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
 {
-    FIXME("STUB: %i %s\n",iImageList,debugstr_guid(&riid));
-    return E_NOINTERFACE;
+    HIMAGELIST hLarge, hSmall;
+    HIMAGELIST hNew;
+    HRESULT ret = E_FAIL;
+
+    /* Wine currently only maintains large and small image lists */
+    if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && 
(iImageList != SHIL_SYSSMALL))
+    {
+        FIXME("Unsupported image list %i requested\n", iImageList);
+        return E_FAIL;
+    }
+
+    Shell_GetImageLists(&hLarge, &hSmall);
+    hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall);
+
+    /* Get the interface for the new image list */
+    if (hNew)
+    {
+        ret = HIMAGELIST_QueryInterface(hNew, riid, ppv);
+        ImageList_Destroy(hNew);
+    }
+
+    return ret;
 }
 
 /*************************************************************************


Reply via email to