You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Added patch to set SFGAO_HASSUBFOLDER only when there are really subfolders.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
From d9a2ea5065ced402ffe4551d7d863450310c1978 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: shell32: Set SFGAO_HASSUBFOLDER correctly for unixfs.
|
||||
|
||||
---
|
||||
dlls/shell32/shfldr_unixfs.c | 26 ++++++++++++++++++++++----
|
||||
1 file changed, 22 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c
|
||||
index b3b0214..dbc71f2 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;
|
||||
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;
|
||||
@@ -1153,8 +1155,24 @@ static HRESULT WINAPI ShellFolder2_GetAttributesOf(IShellFolder2* iface, UINT ci
|
||||
else
|
||||
HeapFree( GetProcessHeap(), 0, dos_name );
|
||||
}
|
||||
- if (_ILIsFolder(apidl[i]))
|
||||
- *rgfInOut |= SFGAO_FOLDER|SFGAO_HASSUBFOLDER|SFGAO_FILESYSANCESTOR;
|
||||
+ if (_ILIsFolder(apidl[i]))
|
||||
+ {
|
||||
+ IEnumIDList *enum_list;
|
||||
+ IShellFolder2 *child;
|
||||
+
|
||||
+ *rgfInOut |= SFGAO_FOLDER|SFGAO_FILESYSANCESTOR;
|
||||
+
|
||||
+ 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)
|
||||
+ *rgfInOut |= SFGAO_HASSUBFOLDER;
|
||||
+ IEnumIDList_Release(enum_list);
|
||||
+ }
|
||||
+ IShellFolder2_Release(child);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
@@ -0,0 +1,43 @@
|
||||
From b9fa2a0da086a8e964ef959a0f4e9a68779dd2a7 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:12:00 +0200
|
||||
Subject: shell32: Set SFGAO_HASSUBFOLDER correctly for normal shellfolders.
|
||||
|
||||
---
|
||||
dlls/shell32/shlfolder.c | 20 ++++++++++++++++++--
|
||||
1 file changed, 18 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c
|
||||
index 46ccc56..0303924 100644
|
||||
--- a/dlls/shell32/shlfolder.c
|
||||
+++ b/dlls/shell32/shlfolder.c
|
||||
@@ -450,8 +450,24 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
|
||||
*pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE |
|
||||
SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY;
|
||||
|
||||
- if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
- *pdwAttributes |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
+ if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
+ {
|
||||
+ IEnumIDList *enum_list;
|
||||
+ IShellFolder *child;
|
||||
+
|
||||
+ *pdwAttributes |= (SFGAO_FOLDER | SFGAO_FILESYSANCESTOR);
|
||||
+
|
||||
+ if (SUCCEEDED(IShellFolder_BindToObject(psf, pidl, NULL, &IID_IShellFolder, (void **)&child)))
|
||||
+ {
|
||||
+ if (IShellFolder_EnumObjects(child, NULL, SHCONTF_FOLDERS|SHCONTF_INCLUDEHIDDEN, &enum_list) == S_OK)
|
||||
+ {
|
||||
+ if (IEnumIDList_Skip(enum_list, 1) != S_OK)
|
||||
+ *pdwAttributes &= ~SFGAO_HASSUBFOLDER;
|
||||
+ IEnumIDList_Release(enum_list);
|
||||
+ }
|
||||
+ IShellFolder_Release(child);
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
*pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
1
patches/shell32-SFGAO_HASSUBFOLDER/definition
Normal file
1
patches/shell32-SFGAO_HASSUBFOLDER/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [24851] Only set SFGAO_HASSUBFOLDER when there are really subfolders
|
Reference in New Issue
Block a user