From 088ca2f71d052c99f8e3bf8d22e6a677bc547244 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 31 May 2015 00:29:12 +0200 Subject: [PATCH] Added patch to avoid using unixfs for devices without mountpoint. --- README.md | 3 +- debian/changelog | 1 + patches/patchinstall.sh | 50 ++++++--- ...se-unixfs-for-devices-without-mountp.patch | 101 ++++++++++++++++++ patches/shell32-UnixFS/definition | 1 + 5 files changed, 138 insertions(+), 18 deletions(-) create mode 100644 patches/shell32-UnixFS/0001-shell32-Do-not-use-unixfs-for-devices-without-mountp.patch create mode 100644 patches/shell32-UnixFS/definition diff --git a/README.md b/README.md index e8b5e95f..d12c4bd8 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 [16]:** +**Bug fixes and features included in the next upcoming release [17]:** * Add shell32 placeholder icons to match offsets with Windows ([Wine Bug #30185](https://bugs.winehq.org/show_bug.cgi?id=30185)) * Add stub for iphlpapi.ConvertInterfaceLuidToGuid ([Wine Bug #38576](https://bugs.winehq.org/show_bug.cgi?id=38576)) @@ -49,6 +49,7 @@ Included bug fixes and improvements * Also handle '\r' as whitespace in wbemprox queries * Also output winedbg system information to the terminal, not only to dialog * Assign a drive serial number during prefix creation/update ([Wine Bug #17823](https://bugs.winehq.org/show_bug.cgi?id=17823)) +* Do not use unixfs for devices without mountpoint * Fix NULL pointer dereference in get_frame_by_name ([Wine Bug #34982](https://bugs.winehq.org/show_bug.cgi?id=34982)) * Fix crash in Gothic 1/2 with builtin directmusic caused by wrong return value ([Wine Bug #7425](https://bugs.winehq.org/show_bug.cgi?id=7425)) * Fix handling of opening a file with RootDirectory pointing to a file handle diff --git a/debian/changelog b/debian/changelog index a1ac2bce..a8c73451 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ wine-staging (1.7.44) UNRELEASED; urgency=low * Added patch to fix scaling behaviour of images and mipmap levels in IDirect3DTexture2_Load. * Added patchset to fix various upstream issues detected by Coverity. + * Added patch to avoid using unixfs for devices without mountpoint. * Revert upstream patch which causes broken rendering in various games. * Removed patch to reset device state in SysKeyboard*Impl_Acquire (accepted upstream). diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 55530b14..4c208501 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -229,6 +229,7 @@ patch_enable_all () enable_shell32_RunDLL_CallEntry16="$1" enable_shell32_SHCreateSessionKey="$1" enable_shell32_SHFileOperation="$1" + enable_shell32_UnixFS="$1" enable_shlwapi_AssocGetPerceivedType="$1" enable_shlwapi_UrlCombine="$1" enable_urlmon_CoInternetSetFeatureEnabled="$1" @@ -757,6 +758,9 @@ patch_enable () shell32-SHFileOperation) enable_shell32_SHFileOperation="$2" ;; + shell32-UnixFS) + enable_shell32_UnixFS="$2" + ;; shlwapi-AssocGetPerceivedType) enable_shlwapi_AssocGetPerceivedType="$2" ;; @@ -4599,6 +4603,18 @@ if test "$enable_shell32_SHFileOperation" -eq 1; then ) >> "$patchlist" fi +# Patchset shell32-UnixFS +# | +# | Modified files: +# | * dlls/shell32/shfldr_desktop.c, dlls/shell32/tests/shlfolder.c +# | +if test "$enable_shell32_UnixFS" -eq 1; then + patch_apply shell32-UnixFS/0001-shell32-Do-not-use-unixfs-for-devices-without-mountp.patch + ( + echo '+ { "Michael Müller", "shell32: Do not use unixfs for devices without mountpoint.", 1 },'; + ) >> "$patchlist" +fi + # Patchset shlwapi-AssocGetPerceivedType # | # | Modified files: @@ -5025,15 +5041,15 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-resource_check_usage +# Patchset wined3d-UnhandledBlendFactor # | # | Modified files: -# | * dlls/wined3d/resource.c +# | * dlls/wined3d/state.c # | -if test "$enable_wined3d_resource_check_usage" -eq 1; then - patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch +if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then + patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch ( - echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; ) >> "$patchlist" fi @@ -5049,6 +5065,18 @@ if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-resource_check_usage +# | +# | Modified files: +# | * dlls/wined3d/resource.c +# | +if test "$enable_wined3d_resource_check_usage" -eq 1; then + patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch + ( + echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Multisampling # | # | This patchset fixes the following Wine bugs: @@ -5098,18 +5126,6 @@ if test "$enable_wined3d_Revert_PixelFormat" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-UnhandledBlendFactor -# | -# | Modified files: -# | * dlls/wined3d/state.c -# | -if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then - patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: diff --git a/patches/shell32-UnixFS/0001-shell32-Do-not-use-unixfs-for-devices-without-mountp.patch b/patches/shell32-UnixFS/0001-shell32-Do-not-use-unixfs-for-devices-without-mountp.patch new file mode 100644 index 00000000..b628db00 --- /dev/null +++ b/patches/shell32-UnixFS/0001-shell32-Do-not-use-unixfs-for-devices-without-mountp.patch @@ -0,0 +1,101 @@ +From 3f14ae155bcfb8145cab8f800366231563d30eac Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 30 May 2015 23:31:34 +0200 +Subject: shell32: Do not use unixfs for devices without mountpoint. + +--- + dlls/shell32/shfldr_desktop.c | 17 ++++++++++++++++- + dlls/shell32/tests/shlfolder.c | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 48 insertions(+), 1 deletion(-) + +diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c +index 4aa1dcf..addf6a7 100644 +--- a/dlls/shell32/shfldr_desktop.c ++++ b/dlls/shell32/shfldr_desktop.c +@@ -184,11 +184,26 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, + } + else if (PathGetDriveNumberW (lpszDisplayName) >= 0) + { ++ /* ++ * UNIXFS can't handle drives without a mount point yet. We fall back ++ * to use the MyComputer interface if we can't get the file attributes ++ * on the device. ++ */ ++ char drivePath[] = "A:\\"; ++ drivePath[0] = 'A' + PathGetDriveNumberW(lpszDisplayName); ++ + /* it's a filesystem path with a drive. Let MyComputer/UnixDosFolder parse it */ +- if (UNIXFS_is_rooted_at_desktop()) ++ if (UNIXFS_is_rooted_at_desktop() && ++ GetFileAttributesA(drivePath) != INVALID_FILE_ATTRIBUTES) ++ { + pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder); ++ TRACE("Using unixfs for %s\n", debugstr_w(lpszDisplayName)); ++ } + else ++ { + pidlTemp = _ILCreateMyComputer (); ++ TRACE("Using MyComputer for %s\n", debugstr_w(lpszDisplayName)); ++ } + szNext = lpszDisplayName; + } + else if (PathIsUNCW(lpszDisplayName)) +diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c +index 1b457bb..f84bf32 100644 +--- a/dlls/shell32/tests/shlfolder.c ++++ b/dlls/shell32/tests/shlfolder.c +@@ -4235,12 +4235,34 @@ static void test_ShellItemArrayGetAttributes(void) + Cleanup(); + } + ++static WCHAR *get_empty_cddrive(void) ++{ ++ static WCHAR cdrom_drive[] = {'A',':','\\',0}; ++ DWORD drives = GetLogicalDrives(); ++ ++ cdrom_drive[0] = 'A'; ++ while (drives) ++ { ++ if ((drives & 1) && ++ GetDriveTypeW(cdrom_drive) == DRIVE_CDROM && ++ GetFileAttributesW(cdrom_drive) == INVALID_FILE_ATTRIBUTES) ++ { ++ return cdrom_drive; ++ } ++ ++ drives = drives >> 1; ++ cdrom_drive[0]++; ++ } ++ return NULL; ++} ++ + static void test_SHParseDisplayName(void) + { + LPITEMIDLIST pidl1, pidl2; + IShellFolder *desktop; + WCHAR dirW[MAX_PATH]; + WCHAR nameW[10]; ++ WCHAR *cdrom; + HRESULT hr; + BOOL ret, is_wow64; + +@@ -4312,6 +4334,16 @@ if (0) + } + + IShellFolder_Release(desktop); ++ ++ cdrom = get_empty_cddrive(); ++ if (!cdrom) ++ skip("No empty cdrom drive found, skipping test\n"); ++ else ++ { ++ hr = pSHParseDisplayName(cdrom, NULL, &pidl1, 0, NULL); ++ ok(hr == S_OK, "failed %08x\n", hr); ++ if (SUCCEEDED(hr)) pILFree(pidl1); ++ } + } + + static void test_desktop_IPersist(void) +-- +2.4.2 + diff --git a/patches/shell32-UnixFS/definition b/patches/shell32-UnixFS/definition new file mode 100644 index 00000000..6340c510 --- /dev/null +++ b/patches/shell32-UnixFS/definition @@ -0,0 +1 @@ +Fixes: Do not use unixfs for devices without mountpoint