[SHELL32]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 2 May 2016 13:50:13 +0000 (13:50 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 2 May 2016 13:50:13 +0000 (13:50 +0000)
- Fix loading shortcut icons. The previous code passed a full pidl to GetUIObjectOf which is really wrong.
CORE-11158

svn path=/trunk/; revision=71233

reactos/dll/win32/shell32/folders.cpp

index da89ff6..3168e5a 100644 (file)
@@ -370,21 +370,17 @@ HRESULT GenericExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl
             else if (!lstrcmpiA(sTemp, "lnkfile"))
             {
                 /* extract icon from shell shortcut */
-                CComPtr<IShellFolder>        dsf;
                 CComPtr<IShellLinkW>        psl;
 
-                if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
-                {
-                    HRESULT hr = dsf->GetUIObjectOf(NULL, 1, &pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl));
+                HRESULT hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl));
 
-                    if (SUCCEEDED(hr))
-                    {
-                        hr = psl->GetIconLocation(wTemp, MAX_PATH, &icon_idx);
+                if (SUCCEEDED(hr))
+                {
+                    hr = psl->GetIconLocation(wTemp, MAX_PATH, &icon_idx);
 
-                        if (SUCCEEDED(hr) && *sTemp)
-                            found = TRUE;
+                    if (SUCCEEDED(hr) && *sTemp)
+                        found = TRUE;
 
-                    }
                 }
             }
         }