shell32: Set the stream and storage attributes where needed.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-01-28 15:32:50 +00:00 committed by Alexandre Julliard
parent a77c0ebc80
commit 77c313b8d6
2 changed files with 17 additions and 1 deletions

View File

@ -1154,7 +1154,10 @@ static HRESULT WINAPI ShellFolder2_GetAttributesOf(IShellFolder2* iface, UINT ci
HeapFree( GetProcessHeap(), 0, dos_name );
}
if (_ILIsFolder(apidl[i]))
*attrs |= SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR;
*attrs |= SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR |
SFGAO_STORAGEANCESTOR | SFGAO_STORAGE;
else
*attrs |= SFGAO_STREAM;
}
}

View File

@ -388,6 +388,14 @@ static void test_EnumObjects(IShellFolder *iFolder)
SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
SFGAO_CAPABILITYMASK | SFGAO_FILESYSTEM,
};
static const ULONG full_attrs[5] =
{
SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
SFGAO_CAPABILITYMASK | SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR,
SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
SFGAO_CAPABILITYMASK | SFGAO_STREAM | SFGAO_FILESYSTEM,
};
hr = IShellFolder_EnumObjects(iFolder, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList);
ok(hr == S_OK, "EnumObjects failed %08x\n", hr);
@ -440,6 +448,11 @@ static void test_EnumObjects(IShellFolder *iFolder)
ok(flags == attrs[i] ||
flags == (attrs[i] & ~SFGAO_FILESYSANCESTOR), /* Win9x, NT4 */
"GetAttributesOf[%i] got %08x, expected %08x\n", i, flags, attrs[i]);
flags = ~0u;
hr = IShellFolder_GetAttributesOf(iFolder, 1, (LPCITEMIDLIST*)(idlArr + i), &flags);
ok(hr == S_OK, "GetAttributesOf returns %08x\n", hr);
ok((flags & ~SFGAO_HASSUBFOLDER) == full_attrs[i], "%d: got %08x expected %08x\n", i, flags, full_attrs[i]);
}
for (i=0;i<5;i++)