mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 21:44:31 +00:00
#595 failed at non-Desktop folder. We should use ILGetDisplayNameExW instead of SHGetPathFromLDList to get path from psf and pidl. CORE-9196
This commit is contained in:
parent
d5440316fa
commit
1829f5fed7
|
@ -161,7 +161,7 @@ getShellClassInfo(LPCWSTR Entry, LPWSTR pszValue, DWORD cchValueLen, LPCWSTR Ini
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT
|
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)
|
LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags)
|
||||||
{
|
{
|
||||||
DWORD dwFileAttrs;
|
DWORD dwFileAttrs;
|
||||||
|
@ -178,14 +178,15 @@ getIconLocationForFolder(IShellFolder * psf, LPCITEMIDLIST pidl, UINT uFlags,
|
||||||
goto Quit;
|
goto Quit;
|
||||||
|
|
||||||
// get path
|
// get path
|
||||||
SHGetPathFromIDListW(pidl, wszPath);
|
if (!ILGetDisplayNameExW(psf, pidl, wszPath, 0))
|
||||||
|
goto Quit;
|
||||||
if (!PathIsDirectoryW(wszPath))
|
if (!PathIsDirectoryW(wszPath))
|
||||||
goto Quit;
|
goto Quit;
|
||||||
|
|
||||||
// read-only or system folder?
|
// read-only or system folder?
|
||||||
dwFileAttrs = GetFileAttributes(wszPath);
|
dwFileAttrs = _ILGetFileAttributes(ILFindLastID(pidl), NULL, 0);
|
||||||
if ((dwFileAttrs & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) == 0)
|
if ((dwFileAttrs & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY)) == 0)
|
||||||
goto Quit;
|
goto Quit;
|
||||||
|
|
||||||
// build the full path of ini file
|
// build the full path of ini file
|
||||||
StringCchCopyW(wszIniFullPath, _countof(wszIniFullPath), wszPath);
|
StringCchCopyW(wszIniFullPath, _countof(wszIniFullPath), wszPath);
|
||||||
|
|
Loading…
Reference in a new issue