From 1a570d8bbb8593dad2361c8da63c1eb79274c923 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Mon, 2 May 2016 13:50:13 +0000 Subject: [PATCH] [SHELL32] - 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 | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/reactos/dll/win32/shell32/folders.cpp b/reactos/dll/win32/shell32/folders.cpp index da89ff660e2..3168e5a9e0e 100644 --- a/reactos/dll/win32/shell32/folders.cpp +++ b/reactos/dll/win32/shell32/folders.cpp @@ -370,21 +370,17 @@ HRESULT GenericExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl else if (!lstrcmpiA(sTemp, "lnkfile")) { /* extract icon from shell shortcut */ - CComPtr dsf; CComPtr psl; - if (SUCCEEDED(SHGetDesktopFolder(&dsf))) + HRESULT hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl)); + + if (SUCCEEDED(hr)) { - HRESULT hr = dsf->GetUIObjectOf(NULL, 1, &pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl)); + 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; - - } } } }