[PATCH 2/2] shell32: Set the stream and storage attributes where needed.

Huw Davies huw at codeweavers.com
Thu Jan 28 09:32:50 CST 2016


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 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 2782157..be1ba81 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 72aaa02..da903b0 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++)
-- 
2.7.0




More information about the wine-patches mailing list