Rebase against f232252951fec637758f6b2c4eeda1c0e0650310.

This commit is contained in:
Alistair Leslie-Hughes
2021-09-16 09:35:15 +10:00
parent ad56d6b3d3
commit d918a0ca3f
8 changed files with 41 additions and 260 deletions

View File

@@ -1,56 +0,0 @@
From 357fccddcd9891844a0d973d39b1bde6f6163033 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 15 Aug 2015 21:09:22 +0200
Subject: [PATCH] shell32: Set SFGAO_HASSUBFOLDER correctly for
unixfs.
---
dlls/shell32/shfldr_unixfs.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c
index 92d1728..ac24871 100644
--- a/dlls/shell32/shfldr_unixfs.c
+++ b/dlls/shell32/shfldr_unixfs.c
@@ -1143,8 +1143,10 @@ static HRESULT WINAPI ShellFolder2_GetAttributesOf(IShellFolder2* iface, UINT ci
SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSTEM | SFGAO_LINK;
lstrcpyA(szAbsolutePath, This->m_pszPath);
pszRelativePath = szAbsolutePath + lstrlenA(szAbsolutePath);
- for (i=0; i<cidl; i++) {
- if (!(This->m_dwAttributes & SFGAO_FILESYSTEM)) {
+ for (i=0; i<cidl; i++)
+ {
+ if (!(This->m_dwAttributes & SFGAO_FILESYSTEM))
+ {
WCHAR *dos_name;
if (!UNIXFS_filename_from_shitemid(apidl[i], pszRelativePath))
return E_INVALIDARG;
@@ -1154,8 +1156,23 @@ static HRESULT WINAPI ShellFolder2_GetAttributesOf(IShellFolder2* iface, UINT ci
heap_free( dos_name );
}
if (_ILIsFolder(apidl[i]))
- *attrs |= SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR |
- SFGAO_STORAGEANCESTOR | SFGAO_STORAGE;
+ {
+ IEnumIDList *enum_list;
+ IShellFolder2 *child;
+
+ *attrs |= SFGAO_FOLDER | SFGAO_FILESYSANCESTOR | SFGAO_STORAGEANCESTOR | SFGAO_STORAGE;
+
+ if (SUCCEEDED(IShellFolder2_BindToObject(iface, apidl[i], NULL, &IID_IShellFolder2, (void **)&child)))
+ {
+ if (IShellFolder2_EnumObjects(child, NULL, SHCONTF_FOLDERS|SHCONTF_INCLUDEHIDDEN, &enum_list) == S_OK)
+ {
+ if (IEnumIDList_Skip(enum_list, 1) == S_OK)
+ *attrs |= SFGAO_HASSUBFOLDER;
+ IEnumIDList_Release(enum_list);
+ }
+ IShellFolder2_Release(child);
+ }
+ }
else
*attrs |= SFGAO_STREAM;
if ((*attrs & SFGAO_LINK))
--
1.9.1