More robust code for querying ShellFolder attributes (some ShellFolders ignore the flag mask in GetAttributesOf).
diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 7be1e32..9bd7261 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c
@@ -388,7 +388,7 @@ dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; r = IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes); - if (FAILED(r) || !dwAttributes) + if (FAILED(r) || !(dwAttributes & (SFGAO_FILESYSANCESTOR|SFGAO_FILESYSTEM))) bEnabled = FALSE; } if (lpBrowseInfo->ulFlags & BIF_RETURNONLYFSDIRS) @@ -396,8 +396,11 @@ dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM; r = IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes); - if (FAILED(r) || (dwAttributes != (SFGAO_FOLDER | SFGAO_FILESYSTEM))) + if (FAILED(r) || + ((dwAttributes & (SFGAO_FOLDER|SFGAO_FILESYSTEM)) != (SFGAO_FOLDER|SFGAO_FILESYSTEM))) + { bEnabled = FALSE; + } } SendMessageW(info->hWnd, BFFM_ENABLEOK, 0, (LPARAM)bEnabled); }