From b8546ff85a686300f52aa8bf7e58bbd2171dc2d9 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 15 Aug 2015 21:28:54 +0200 Subject: [PATCH] Added patch to set SFGAO_HASSUBFOLDER only when there are really subfolders. --- README.md | 3 +- debian/changelog | 1 + patches/patchinstall.sh | 21 +++++++ ...AO_HASSUBFOLDER-correctly-for-unixfs.patch | 56 +++++++++++++++++++ ...O_HASSUBFOLDER-correctly-for-normal-.patch | 43 ++++++++++++++ patches/shell32-SFGAO_HASSUBFOLDER/definition | 1 + 6 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch create mode 100644 patches/shell32-SFGAO_HASSUBFOLDER/0002-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-normal-.patch create mode 100644 patches/shell32-SFGAO_HASSUBFOLDER/definition diff --git a/README.md b/README.md index 7c589b41..011f611e 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [8]:** +**Bug fixes and features included in the next upcoming release [9]:** * Add IDragSourceHelper stub interface ([Wine Bug #24699](https://bugs.winehq.org/show_bug.cgi?id=24699)) * Catch invalid memory accesses in imagehlp.CheckSumMappedFile @@ -48,6 +48,7 @@ Included bug fixes and improvements * Implement special handling for calling GetChildContainer with an empty string ([Wine Bug #38014](https://bugs.winehq.org/show_bug.cgi?id=38014)) * Implement vcomp locking functions ([Wine Bug #26688](https://bugs.winehq.org/show_bug.cgi?id=26688)) * Improve startup performance by delaying font initialization +* Only set SFGAO_HASSUBFOLDER when there are really subfolders ([Wine Bug #24851](https://bugs.winehq.org/show_bug.cgi?id=24851)) * Properly implement imagehlp.ImageLoad and ImageUnload diff --git a/debian/changelog b/debian/changelog index 38f484a5..a6e5b274 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ wine-staging (1.7.50) UNRELEASED; urgency=low * Added patch for shell32 IDragSourceHelper stub interface. * Added patch to improve startup performance by delaying font initialization (fixes Wine Staging Bug #401). + * Added patch to set SFGAO_HASSUBFOLDER only when there are really subfolders. * Removed patch to move security cookie initialization from memory management to loader. -- Sebastian Lackner Tue, 11 Aug 2015 06:12:14 +0200 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 87ec0e9e..1e4c5974 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -232,6 +232,7 @@ patch_enable_all () enable_shell32_Progress_Dialog="$1" enable_shell32_RunDLL_CallEntry16="$1" enable_shell32_Run_Dialog="$1" + enable_shell32_SFGAO_HASSUBFOLDER="$1" enable_shell32_SHCreateSessionKey="$1" enable_shell32_SHFileOperation="$1" enable_shell32_UnixFS="$1" @@ -784,6 +785,9 @@ patch_enable () shell32-Run_Dialog) enable_shell32_Run_Dialog="$2" ;; + shell32-SFGAO_HASSUBFOLDER) + enable_shell32_SFGAO_HASSUBFOLDER="$2" + ;; shell32-SHCreateSessionKey) enable_shell32_SHCreateSessionKey="$2" ;; @@ -4762,6 +4766,23 @@ if test "$enable_shell32_Run_Dialog" -eq 1; then ) >> "$patchlist" fi +# Patchset shell32-SFGAO_HASSUBFOLDER +# | +# | This patchset fixes the following Wine bugs: +# | * [#24851] Only set SFGAO_HASSUBFOLDER when there are really subfolders +# | +# | Modified files: +# | * dlls/shell32/shfldr_unixfs.c, dlls/shell32/shlfolder.c +# | +if test "$enable_shell32_SFGAO_HASSUBFOLDER" -eq 1; then + patch_apply shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch + patch_apply shell32-SFGAO_HASSUBFOLDER/0002-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-normal-.patch + ( + echo '+ { "Michael Müller", "shell32: Set SFGAO_HASSUBFOLDER correctly for unixfs.", 1 },'; + echo '+ { "Michael Müller", "shell32: Set SFGAO_HASSUBFOLDER correctly for normal shellfolders.", 1 },'; + ) >> "$patchlist" +fi + # Patchset shell32-SHCreateSessionKey # | # | This patchset fixes the following Wine bugs: diff --git a/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch b/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch new file mode 100644 index 00000000..eec6e65c --- /dev/null +++ b/patches/shell32-SFGAO_HASSUBFOLDER/0001-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-unixfs.patch @@ -0,0 +1,56 @@ +From d9a2ea5065ced402ffe4551d7d863450310c1978 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +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; im_dwAttributes & SFGAO_FILESYSTEM)) { ++ for (i=0; im_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 + diff --git a/patches/shell32-SFGAO_HASSUBFOLDER/0002-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-normal-.patch b/patches/shell32-SFGAO_HASSUBFOLDER/0002-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-normal-.patch new file mode 100644 index 00000000..6e3d8a30 --- /dev/null +++ b/patches/shell32-SFGAO_HASSUBFOLDER/0002-shell32-Set-SFGAO_HASSUBFOLDER-correctly-for-normal-.patch @@ -0,0 +1,43 @@ +From b9fa2a0da086a8e964ef959a0f4e9a68779dd2a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +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 + diff --git a/patches/shell32-SFGAO_HASSUBFOLDER/definition b/patches/shell32-SFGAO_HASSUBFOLDER/definition new file mode 100644 index 00000000..13807265 --- /dev/null +++ b/patches/shell32-SFGAO_HASSUBFOLDER/definition @@ -0,0 +1 @@ +Fixes: [24851] Only set SFGAO_HASSUBFOLDER when there are really subfolders