From bfabcd117e2d58874b680a7b24e1a795f949d58c Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 18 Oct 2015 16:31:04 +0200 Subject: [PATCH] Added patch to always use 64-bit registry view on WOW64 setups. --- README.md | 3 +- debian/changelog | 1 + ...-64-bit-registry-view-on-WOW64-setup.patch | 34 +++++++++++++++++++ patches/ntdll-DllOverrides_WOW64/definition | 1 + ...-to-determine-loadorder-HKCU-app-key.patch | 6 ++-- patches/ntdll-DllRedirects/definition | 1 + patches/patchinstall.sh | 29 +++++++++++++--- 7 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 patches/ntdll-DllOverrides_WOW64/0001-ntdll-Always-use-64-bit-registry-view-on-WOW64-setup.patch create mode 100644 patches/ntdll-DllOverrides_WOW64/definition diff --git a/README.md b/README.md index 6dc6f69f..62a649fe 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,11 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [7]:** +**Bug fixes and features included in the next upcoming release [8]:** * Add implementation for IDXGIOutput::GetDesc ([Wine Bug #32006](https://bugs.winehq.org/show_bug.cgi?id=32006)) * Add implementation for comctl32.PROPSHEET_InsertPage. ([Wine Bug #25625](https://bugs.winehq.org/show_bug.cgi?id=25625)) +* Always use 64-bit registry view on WOW64 setups * Do not check if object was signaled after user APC in server_select * Fix the initialization of combined DACLs when the new DACL is empty ([Wine Bug #38423](https://bugs.winehq.org/show_bug.cgi?id=38423)) * Return WN_NOT_CONNECTED from WNetGetUniversalName REMOTE_NAME_INFO_LEVEL stub ([Wine Bug #39452](https://bugs.winehq.org/show_bug.cgi?id=39452)) diff --git a/debian/changelog b/debian/changelog index b2ca2acd..11bc4fb2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ wine-staging (1.7.53) UNRELEASED; urgency=low * Added patch to implement comctl32.PROPSHEET_InsertPage. * Added patch to return WN_NOT_CONNECTED from WNetGetUniversalName REMOTE_NAME_INFO_LEVEL stub. + * Added patch to always use 64-bit registry view on WOW64 setups. * Removed patch to mark RegOpenKeyExA, RegCloseKey and RegQueryValueExA as hotpatchable (accepted upstream). * Removed patch to mark BitBlt and StretchDIBits as hotpatchable (accepted diff --git a/patches/ntdll-DllOverrides_WOW64/0001-ntdll-Always-use-64-bit-registry-view-on-WOW64-setup.patch b/patches/ntdll-DllOverrides_WOW64/0001-ntdll-Always-use-64-bit-registry-view-on-WOW64-setup.patch new file mode 100644 index 00000000..e13124f0 --- /dev/null +++ b/patches/ntdll-DllOverrides_WOW64/0001-ntdll-Always-use-64-bit-registry-view-on-WOW64-setup.patch @@ -0,0 +1,34 @@ +From 625a74b841194e5895198cd1cdc2991cb42bdead Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 18 Oct 2015 15:50:04 +0200 +Subject: ntdll: Always use 64-bit registry view on WOW64 setups. + +--- + dlls/ntdll/loadorder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c +index 401d256..8a0b139 100644 +--- a/dlls/ntdll/loadorder.c ++++ b/dlls/ntdll/loadorder.c +@@ -316,7 +316,7 @@ static HANDLE get_standard_key(void) + RtlInitUnicodeString( &nameW, DllOverridesW ); + + /* @@ Wine registry key: HKCU\Software\Wine\DllOverrides */ +- if (NtOpenKey( &std_key, KEY_ALL_ACCESS, &attr )) std_key = 0; ++ if (NtOpenKey( &std_key, KEY_WOW64_64KEY | KEY_ALL_ACCESS, &attr )) std_key = 0; + NtClose( root ); + } + return std_key; +@@ -359,7 +359,7 @@ static HANDLE get_app_key( const WCHAR *app_name ) + RtlInitUnicodeString( &nameW, str ); + + /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\DllOverrides */ +- if (NtOpenKey( &app_key, KEY_ALL_ACCESS, &attr )) app_key = 0; ++ if (NtOpenKey( &app_key, KEY_WOW64_64KEY | KEY_ALL_ACCESS, &attr )) app_key = 0; + NtClose( root ); + RtlFreeHeap( GetProcessHeap(), 0, str ); + return app_key; +-- +2.6.1 + diff --git a/patches/ntdll-DllOverrides_WOW64/definition b/patches/ntdll-DllOverrides_WOW64/definition new file mode 100644 index 00000000..d1775249 --- /dev/null +++ b/patches/ntdll-DllOverrides_WOW64/definition @@ -0,0 +1 @@ +Fixes: Always use 64-bit registry view on WOW64 setups diff --git a/patches/ntdll-DllRedirects/0001-ntdll-Move-logic-to-determine-loadorder-HKCU-app-key.patch b/patches/ntdll-DllRedirects/0001-ntdll-Move-logic-to-determine-loadorder-HKCU-app-key.patch index 18bfd9d0..e68b7515 100644 --- a/patches/ntdll-DllRedirects/0001-ntdll-Move-logic-to-determine-loadorder-HKCU-app-key.patch +++ b/patches/ntdll-DllRedirects/0001-ntdll-Move-logic-to-determine-loadorder-HKCU-app-key.patch @@ -35,7 +35,7 @@ index 401d256..d45a85f 100644 + attr.SecurityQualityOfService = NULL; + RtlInitUnicodeString( &nameW, key_name ); + -+ if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) hkey = 0; ++ if (NtOpenKey( &hkey, KEY_WOW64_64KEY | KEY_ALL_ACCESS, &attr )) hkey = 0; + NtClose( root ); + + return hkey; @@ -92,7 +92,7 @@ index 401d256..d45a85f 100644 - RtlInitUnicodeString( &nameW, DllOverridesW ); - - /* @@ Wine registry key: HKCU\Software\Wine\DllOverrides */ -- if (NtOpenKey( &std_key, KEY_ALL_ACCESS, &attr )) std_key = 0; +- if (NtOpenKey( &std_key, KEY_WOW64_64KEY | KEY_ALL_ACCESS, &attr )) std_key = 0; - NtClose( root ); - } + std_key = open_user_reg_key( DllOverridesW ); @@ -135,7 +135,7 @@ index 401d256..d45a85f 100644 - RtlInitUnicodeString( &nameW, str ); - - /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\DllOverrides */ -- if (NtOpenKey( &app_key, KEY_ALL_ACCESS, &attr )) app_key = 0; +- if (NtOpenKey( &app_key, KEY_WOW64_64KEY | KEY_ALL_ACCESS, &attr )) app_key = 0; - NtClose( root ); - RtlFreeHeap( GetProcessHeap(), 0, str ); return app_key; diff --git a/patches/ntdll-DllRedirects/definition b/patches/ntdll-DllRedirects/definition index 530aa808..e580a6b6 100644 --- a/patches/ntdll-DllRedirects/definition +++ b/patches/ntdll-DllRedirects/definition @@ -1,3 +1,4 @@ Fixes: Support for loader dll redirections Depends: ntdll-Loader_Machine_Type +Depends: ntdll-DllOverrides_WOW64 Category: stable diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e999a284..6adb5321 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -184,6 +184,7 @@ patch_enable_all () enable_ntdll_DOS_Attributes="$1" enable_ntdll_Dealloc_Thread_Stack="$1" enable_ntdll_DeviceType_Systemroot="$1" + enable_ntdll_DllOverrides_WOW64="$1" enable_ntdll_DllRedirects="$1" enable_ntdll_Exception="$1" enable_ntdll_FileDispositionInformation="$1" @@ -646,6 +647,9 @@ patch_enable () ntdll-DeviceType_Systemroot) enable_ntdll_DeviceType_Systemroot="$2" ;; + ntdll-DllOverrides_WOW64) + enable_ntdll_DllOverrides_WOW64="$2" + ;; ntdll-DllRedirects) enable_ntdll_DllRedirects="$2" ;; @@ -1893,9 +1897,13 @@ if test "$enable_ntdll_Fix_Alignment" -eq 1; then fi if test "$enable_ntdll_DllRedirects" -eq 1; then + if test "$enable_ntdll_DllOverrides_WOW64" -gt 1; then + abort "Patchset ntdll-DllOverrides_WOW64 disabled, but ntdll-DllRedirects depends on that." + fi if test "$enable_ntdll_Loader_Machine_Type" -gt 1; then abort "Patchset ntdll-Loader_Machine_Type disabled, but ntdll-DllRedirects depends on that." fi + enable_ntdll_DllOverrides_WOW64=1 enable_ntdll_Loader_Machine_Type=1 fi @@ -3995,6 +4003,18 @@ if test "$enable_ntdll_DeviceType_Systemroot" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-DllOverrides_WOW64 +# | +# | Modified files: +# | * dlls/ntdll/loadorder.c +# | +if test "$enable_ntdll_DllOverrides_WOW64" -eq 1; then + patch_apply ntdll-DllOverrides_WOW64/0001-ntdll-Always-use-64-bit-registry-view-on-WOW64-setup.patch + ( + echo '+ { "Sebastian Lackner", "ntdll: Always use 64-bit registry view on WOW64 setups.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-Loader_Machine_Type # | # | This patchset fixes the following Wine bugs: @@ -4013,7 +4033,7 @@ fi # Patchset ntdll-DllRedirects # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Loader_Machine_Type +# | * ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type # | # | Modified files: # | * dlls/ntdll/loader.c, dlls/ntdll/loadorder.c, dlls/ntdll/ntdll_misc.h @@ -5428,7 +5448,7 @@ fi # Patchset uxtheme-GTK_Theming # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Loader_Machine_Type, ntdll-DllRedirects +# | * ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects # | # | Modified files: # | * aclocal.m4, configure.ac, dlls/uxtheme-gtk/Makefile.in, dlls/uxtheme-gtk/button.c, dlls/uxtheme-gtk/combobox.c, dlls @@ -5592,7 +5612,7 @@ fi # Patchset wined3d-CSMT_Helper # | # | This patchset has the following (direct or indirect) dependencies: -# | * makedep-PARENTSPEC, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn +# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn # | # | Modified files: # | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc @@ -5721,7 +5741,8 @@ fi # Patchset wined3d-CSMT_Main # | # | This patchset has the following (direct or indirect) dependencies: -# | * makedep-PARENTSPEC, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d-CSMT_Helper +# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d- +# | CSMT_Helper # | # | This patchset fixes the following Wine bugs: # | * [#11674] Support for CSMT (command stream) to increase graphic performance