From 99bf902a9729e3e52a5454fac4c1c80328d43d4f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 28 Feb 2015 21:55:43 +0100 Subject: [PATCH] Added patch to fix crash in clip_cursor_notify caused by uninitialized TLS. --- README.md | 3 +- debian/changelog | 1 + patches/patchinstall.sh | 16 +++++++++++ ...ze-thread-data-in-clip_cursor_notify.patch | 28 +++++++++++++++++++ patches/winex11-Thread_Data/definition | 1 + 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 patches/winex11-Thread_Data/0001-winex11-Initialize-thread-data-in-clip_cursor_notify.patch create mode 100644 patches/winex11-Thread_Data/definition diff --git a/README.md b/README.md index 972932fe..68d33856 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [12]:** +**Bugfixes and features included in the next upcoming release [13]:** * Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163)) * Add support for CopyFileEx progress callback ([Wine Bug #22692](https://bugs.winehq.org/show_bug.cgi?id=22692)) @@ -47,6 +47,7 @@ Included bug fixes and improvements * EA Origin needs support for job objects ([Wine Bug #33723](https://bugs.winehq.org/show_bug.cgi?id=33723)) * Enforce that surfaces are flushed after ReleaseDC * Fallback to global key state for threads without a queue ([Wine Bug #27238](https://bugs.winehq.org/show_bug.cgi?id=27238)) +* Fix crash in clip_cursor_notify caused by uninitialized TLS * Fix race-condition when threads are killed during shutdown * Implement SetFileInformationByHandle * Process Hacker 2.x needs ntoskrnl.ProbeForRead ([Wine Bug #38103](https://bugs.winehq.org/show_bug.cgi?id=38103)) diff --git a/debian/changelog b/debian/changelog index ef8ecf4b..c876f670 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,7 @@ wine-staging (1.7.38) UNRELEASED; urgency=low * Added patch to implement PROGDLG_AUTOTIME for IProgressDialog. * Added patch to implement support for NULL job handles in IsProcessInJob. * Added patch to implement support for waiting on job object. + * Added patch to fix crash in clip_cursor_notify caused by uninitialized TLS. * Removed patch to properly call DriverUnload when unloading device drivers (accepted upstream). * Removed patch to allow Accept-Encoding for HTTP/1.0 in wininet (accepted upstream). * Removed patch to declare pDirectInputCreateEx in a MSVC compatible way (accepted upstream). diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 1ee6a38e..1ad5f426 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -204,6 +204,7 @@ patch_enable_all () enable_winepulse_PulseAudio_Support="$1" enable_winex11_CandidateWindowPos="$1" enable_winex11_Clipboard_HTML="$1" + enable_winex11_Thread_Data="$1" enable_winex11_Window_Groups="$1" enable_winex11_Window_Style="$1" enable_winex11_XEMBED="$1" @@ -647,6 +648,9 @@ patch_enable () winex11-Clipboard_HTML) enable_winex11_Clipboard_HTML="$2" ;; + winex11-Thread_Data) + enable_winex11_Thread_Data="$2" + ;; winex11-Window_Groups) enable_winex11_Window_Groups="$2" ;; @@ -4031,6 +4035,18 @@ if test "$enable_winex11_Clipboard_HTML" -eq 1; then ) >> "$patchlist" fi +# Patchset winex11-Thread_Data +# | +# | Modified files: +# | * dlls/winex11.drv/mouse.c +# | +if test "$enable_winex11_Thread_Data" -eq 1; then + patch_apply winex11-Thread_Data/0001-winex11-Initialize-thread-data-in-clip_cursor_notify.patch + ( + echo '+ { "Sebastian Lackner", "winex11: Initialize thread data in clip_cursor_notify.", 1 },'; + ) >> "$patchlist" +fi + # Patchset winex11-Window_Groups # | # | This patchset fixes the following Wine bugs: diff --git a/patches/winex11-Thread_Data/0001-winex11-Initialize-thread-data-in-clip_cursor_notify.patch b/patches/winex11-Thread_Data/0001-winex11-Initialize-thread-data-in-clip_cursor_notify.patch new file mode 100644 index 00000000..c3564193 --- /dev/null +++ b/patches/winex11-Thread_Data/0001-winex11-Initialize-thread-data-in-clip_cursor_notify.patch @@ -0,0 +1,28 @@ +From da71d74a03fa8d8150c451c7a085c09f045fba49 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 28 Feb 2015 21:52:40 +0100 +Subject: winex11: Initialize thread data in clip_cursor_notify. + +Fixes a crash with Slender - The Arrival when trying to start the game. +For some reason the thread local data is not initialized yet when we enter +the function. +--- + dlls/winex11.drv/mouse.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c +index 5f5bdeb..95efa19 100644 +--- a/dlls/winex11.drv/mouse.c ++++ b/dlls/winex11.drv/mouse.c +@@ -453,7 +453,7 @@ void reset_clipping_window(void) + */ + LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ) + { +- struct x11drv_thread_data *data = x11drv_thread_data(); ++ struct x11drv_thread_data *data = x11drv_init_thread_data(); + + if (hwnd == GetDesktopWindow()) /* change the clip window stored in the desktop process */ + { +-- +2.3.0 + diff --git a/patches/winex11-Thread_Data/definition b/patches/winex11-Thread_Data/definition new file mode 100644 index 00000000..630d0517 --- /dev/null +++ b/patches/winex11-Thread_Data/definition @@ -0,0 +1 @@ +Fixes: Fix crash in clip_cursor_notify caused by uninitialized TLS