Commit 40336885 authored by Michael Müller's avatar Michael Müller Committed by Vitaly Lipatov

shell32: Set SFGAO_HASSUBFOLDER correctly for normal shellfolders.

parent e8bc1034
......@@ -441,7 +441,23 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder2 *psf, LPCITEMIDLIST pidl, LPDWO
SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY;
if (file_attr & FILE_ATTRIBUTE_DIRECTORY)
*pdwAttributes |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR | SFGAO_STORAGEANCESTOR | SFGAO_STORAGE);
{
IEnumIDList *enum_list;
IShellFolder *child;
*pdwAttributes |= (SFGAO_FOLDER | SFGAO_FILESYSANCESTOR | SFGAO_STORAGEANCESTOR | SFGAO_STORAGE);
if (SUCCEEDED(IShellFolder2_BindToObject(psf, pidl, NULL, &IID_IShellFolder, (void **)&child)))
{
if (IShellFolder_EnumObjects(child, NULL, SHCONTF_FOLDERS|SHCONTF_INCLUDEHIDDEN, &enum_list) == S_OK)
{
if (IEnumIDList_Skip(enum_list, 1) != S_OK)
*pdwAttributes &= ~SFGAO_HASSUBFOLDER;
IEnumIDList_Release(enum_list);
}
IShellFolder_Release(child);
}
}
else
{
*pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR | SFGAO_STORAGEANCESTOR | SFGAO_STORAGE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment