https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1829f5fed7fd7247e9f7da...
commit 1829f5fed7fd7247e9f7da4dcfcd5c1e0057e907 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Mon Jun 25 02:59:03 2018 +0900 Commit: Hermès BÉLUSCA - MAÏTO hermes.belusca-maito@reactos.org CommitDate: Sun Jun 24 19:59:03 2018 +0200
[SHELL32] Fix desktop.ini folder icon again (retrial of #595) (#632)
#595 failed at non-Desktop folder. We should use ILGetDisplayNameExW instead of SHGetPathFromLDList to get path from psf and pidl. CORE-9196 --- dll/win32/shell32/folders/CFSFolder.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dll/win32/shell32/folders/CFSFolder.cpp b/dll/win32/shell32/folders/CFSFolder.cpp index 6928bf13b5..77d87e6f82 100644 --- a/dll/win32/shell32/folders/CFSFolder.cpp +++ b/dll/win32/shell32/folders/CFSFolder.cpp @@ -161,7 +161,7 @@ getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR Ini }
static HRESULT -getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, UINT uFlags, +getIconLocationForFolder(IShellFolder * psf, PCITEMID_CHILD pidl, UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) { DWORD dwFileAttrs; @@ -178,14 +178,15 @@ getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, UINT uFlags, goto Quit;
// get path - SHGetPathFromIDListW(pidl, wszPath); + if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0)) + goto Quit; if (!PathIsDirectoryW(wszPath)) - goto Quit; + goto Quit;
// read-only or system folder? - dwFileAttrs = GetFileAttributes(wszPath); + dwFileAttrs = _ILGetFileAttributes(ILFindLastID(pidl), NULL, 0); if ((dwFileAttrs & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) == 0) - goto Quit; + goto Quit;
// build the full path of ini file StringCchCopyW(wszIniFullPath, _countof(wszIniFullPath), wszPath);