https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cfdbccf9377d73b1eb4c0d...
commit cfdbccf9377d73b1eb4c0d1b31af4ac778ab0263 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Tue Nov 26 21:45:58 2019 +0900 Commit: GitHub noreply@github.com CommitDate: Tue Nov 26 21:45:58 2019 +0900
[SHELL32] Follow-up of #2076 (#2091)
Fix EXE and SCR file icons. CORE-16533 --- dll/win32/shell32/CExtractIcon.cpp | 15 --------------- dll/win32/shell32/folders/CFSFolder.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/dll/win32/shell32/CExtractIcon.cpp b/dll/win32/shell32/CExtractIcon.cpp index e24f6c12800..26bdb4e9307 100644 --- a/dll/win32/shell32/CExtractIcon.cpp +++ b/dll/win32/shell32/CExtractIcon.cpp @@ -138,21 +138,6 @@ HRESULT STDMETHODCALLTYPE CExtractIcon::SetNormalIcon( { TRACE("(%p, %s, %d)\n", this, debugstr_w(pszFile), iIcon);
- if (lstrcmpiW(PathFindExtensionW(pszFile), L".exe") == 0) - { - if (!PrivateExtractIconExW(pszFile, 0, NULL, NULL, 1)) - { - WCHAR szPath[MAX_PATH]; - GetModuleFileNameW(shell32_hInstance, szPath, _countof(szPath)); - DuplicateString(szPath, &normalIcon.file); - if (!normalIcon.file) - return E_OUTOFMEMORY; - - normalIcon.index = -IDI_SHELL_EXE; - return S_OK; - } - } - DuplicateString(pszFile, &normalIcon.file); if (!normalIcon.file) return E_OUTOFMEMORY; diff --git a/dll/win32/shell32/folders/CFSFolder.cpp b/dll/win32/shell32/folders/CFSFolder.cpp index 6acf3013e43..493eeeafa49 100644 --- a/dll/win32/shell32/folders/CFSFolder.cpp +++ b/dll/win32/shell32/folders/CFSFolder.cpp @@ -312,6 +312,13 @@ HRESULT CFSExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl, RE { ILGetDisplayNameExW(psf, pidl, wTemp, ILGDN_FORPARSING); icon_idx = 0; + + INT ret = ExtractIconExW(wTemp, -1, NULL, NULL, 0); + if (ret <= 0) + { + StringCbCopyW(wTemp, sizeof(wTemp), swShell32Name); + icon_idx = -IDI_SHELL_EXE; + } }
initIcon->SetNormalIcon(wTemp, icon_idx);