From 77c313b8d6cdfaab94758f96b9a59e3107184d3a Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 28 Jan 2016 15:32:50 +0000 Subject: [PATCH] shell32: Set the stream and storage attributes where needed. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/shell32/shfldr_unixfs.c | 5 ++++- dlls/shell32/tests/shlfolder.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 27821579874..be1ba81f4d5 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -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; } } diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 72aaa0207c9..da903b0445d 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -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++)