[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
This commit is contained in:
Giannis Adamopoulos 2016-05-02 13:50:13 +00:00
parent c55c338dfa
commit 1a570d8bbb

View file

@ -370,21 +370,17 @@ HRESULT GenericExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl
else if (!lstrcmpiA(sTemp, "lnkfile")) else if (!lstrcmpiA(sTemp, "lnkfile"))
{ {
/* extract icon from shell shortcut */ /* extract icon from shell shortcut */
CComPtr<IShellFolder> dsf;
CComPtr<IShellLinkW> psl; CComPtr<IShellLinkW> 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)) if (SUCCEEDED(hr) && *sTemp)
{ found = TRUE;
hr = psl->GetIconLocation(wTemp, MAX_PATH, &icon_idx);
if (SUCCEEDED(hr) && *sTemp)
found = TRUE;
}
} }
} }
} }