[SHELL32] Support CSIDL_FLAG_NO_ALIAS (#4381)

Adding the CSIDL_FLAG_NO_ALIAS flag to SHGetSpecialFolderLocation should return the physical PIDL if possible.
CORE-18079
This commit is contained in:
Katayama Hirofumi MZ 2022-03-06 15:25:45 +09:00 committed by GitHub
parent c5f6e744e7
commit 6cb1e57a63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2888,6 +2888,9 @@ HRESULT WINAPI SHGetFolderLocation(
LPITEMIDLIST *ppidl)
{
HRESULT hr = E_INVALIDARG;
#ifdef __REACTOS__
WCHAR szPath[MAX_PATH];
#endif
TRACE("%p 0x%08x %p 0x%08x %p\n",
hwndOwner, nFolder, hToken, dwReserved, ppidl);
@ -2897,6 +2900,15 @@ HRESULT WINAPI SHGetFolderLocation(
if (dwReserved)
return E_INVALIDARG;
#ifdef __REACTOS__
if ((nFolder & CSIDL_FLAG_NO_ALIAS) &&
SHGetSpecialFolderPathW(hwndOwner, szPath, (nFolder & CSIDL_FOLDER_MASK), FALSE))
{
*ppidl = ILCreateFromPathW(szPath);
if (*ppidl)
return S_OK;
}
#endif
/* The virtual folders' locations are not user-dependent */
*ppidl = NULL;
switch (nFolder & CSIDL_FOLDER_MASK)