[SHELL32]
authorAmine Khaldi <amine.khaldi@reactos.org>
Mon, 3 Nov 2014 13:43:01 +0000 (13:43 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Mon, 3 Nov 2014 13:43:01 +0000 (13:43 +0000)
* Apply Wine commit e330a128 by Alexandre Julliard: Use Shell_GetImageLists to retrieve image lists instead of using a global variable.
CORE-8540

svn path=/branches/shell-experiments/; revision=65222

dll/win32/shell32/folders/printers.cpp
dll/win32/shell32/iconcache.cpp
dll/win32/shell32/shell32.cpp
dll/win32/shell32/shlview.cpp
dll/win32/shell32/wine/shell32_main.c
dll/win32/shell32/wine/shell32_main.h

index 5ea8557..06e935b 100644 (file)
@@ -125,17 +125,20 @@ HRESULT WINAPI CPrintersExtractIconW::Extract(LPCWSTR pszFile,
         HICON *phiconSmall, UINT nIconSize)
 {
     int index;
+    HIMAGELIST big_icons, small_icons;
 
     FIXME("(%p) (file=%p index=%d %p %p size=%x) semi-stub\n", this, debugstr_w(pszFile),
           (signed)nIconIndex, phiconLarge, phiconSmall, nIconSize);
 
     index = SIC_GetIconIndex(pszFile, nIconIndex, 0);
 
+    Shell_GetImageLists(&big_icons, &small_icons);
+
     if (phiconLarge)
-        *phiconLarge = ImageList_GetIcon(ShellBigIconList, index, ILD_TRANSPARENT);
+        *phiconLarge = ImageList_GetIcon(big_icons, index, ILD_TRANSPARENT);
 
     if (phiconSmall)
-        *phiconSmall = ImageList_GetIcon(ShellSmallIconList, index, ILD_TRANSPARENT);
+        *phiconSmall = ImageList_GetIcon(small_icons, index, ILD_TRANSPARENT);
 
     return S_OK;
 }
index 2d72dfb..573dd4b 100644 (file)
@@ -37,6 +37,9 @@ typedef struct
 
 static HDPA        sic_hdpa = 0;
 
+static HIMAGELIST ShellSmallIconList;
+static HIMAGELIST ShellBigIconList;
+
 namespace
 {
 extern CRITICAL_SECTION SHELL32_SicCS;
index e2220cf..016f6b0 100644 (file)
@@ -233,8 +233,6 @@ STDAPI DllGetVersion(DLLVERSIONINFO *pdvi)
  *
  */
 HINSTANCE    shell32_hInstance;
-HIMAGELIST   ShellSmallIconList = 0;
-HIMAGELIST   ShellBigIconList = 0;
 
 void *operator new (size_t, void *buf)
 {
index 04819f4..1d0264b 100644 (file)
@@ -587,6 +587,7 @@ BOOL CDefView::InitList()
 {
     SHELLDETAILS    sd;
     WCHAR    szTemp[50];
+    HIMAGELIST big_icons, small_icons;
 
     TRACE("%p\n", this);
 
@@ -608,8 +609,9 @@ BOOL CDefView::InitList()
         FIXME("no SF2\n");
     }
 
-    m_ListView.SetImageList(ShellBigIconList, LVSIL_NORMAL);
-    m_ListView.SetImageList(ShellSmallIconList, LVSIL_SMALL);
+    Shell_GetImageLists(&big_icons, &small_icons);
+    m_ListView.SetImageList(big_icons, LVSIL_NORMAL);
+    m_ListView.SetImageList(small_icons, LVSIL_SMALL);
 
     return TRUE;
 }
index 9ef03eb..932ec2c 100644 (file)
@@ -419,6 +419,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
     HRESULT hr = S_OK;
     BOOL IconNotYetLoaded=TRUE;
     UINT uGilFlags = 0;
+    HIMAGELIST big_icons, small_icons;
 
     TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
           (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
@@ -557,6 +558,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
     }
 
     /* ### icons ###*/
+
+    Shell_GetImageLists( &big_icons, &small_icons );
+
     if (flags & SHGFI_OPENICON)
         uGilFlags |= GIL_OPENICON;
 
@@ -701,9 +705,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
         if (ret && (flags & SHGFI_SYSICONINDEX))
         {
             if (flags & SHGFI_SMALLICON)
-                ret = (DWORD_PTR) ShellSmallIconList;
+                ret = (DWORD_PTR)small_icons;
             else
-                ret = (DWORD_PTR) ShellBigIconList;
+                ret = (DWORD_PTR)big_icons;
         }
     }
 
@@ -711,9 +715,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
     if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
     {
         if (flags & SHGFI_SMALLICON)
-            psfi->hIcon = ImageList_GetIcon( ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
+            psfi->hIcon = ImageList_GetIcon( small_icons, psfi->iIcon, ILD_NORMAL);
         else
-            psfi->hIcon = ImageList_GetIcon( ShellBigIconList, psfi->iIcon, ILD_NORMAL);
+            psfi->hIcon = ImageList_GetIcon( big_icons, psfi->iIcon, ILD_NORMAL);
     }
 
     if (flags & ~SHGFI_KNOWN_FLAGS)
index 722d9db..9b930e6 100644 (file)
@@ -31,8 +31,6 @@ extern "C" {
 */
 extern HMODULE huser32;
 extern HINSTANCE shell32_hInstance;
-extern HIMAGELIST      ShellSmallIconList;
-extern HIMAGELIST      ShellBigIconList;
 
 BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);