Added patch to pass MOUSEHOOKSTRUCTEX struct to mouse hook callback.

This commit is contained in:
Sebastian Lackner 2015-12-27 19:57:46 +01:00
parent 25493b94b1
commit 26ef94413d
5 changed files with 90 additions and 1 deletions

View File

@ -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 [4]:**
**Bug fixes and features included in the next upcoming release [5]:**
* Avoid corruption of caret when SetCaretPos() is called
* Check IsWoW64Process before calling Wow64 functions in UNIXFS_get_unix_path
* Pass MOUSEHOOKSTRUCTEX struct to mouse hook callback ([Wine Bug #38314](https://bugs.winehq.org/show_bug.cgi?id=38314))
* SHMapHandle should not set error when NULL is passed as hShared
* SysAllocStringByteLen should align terminating null WCHAR

View File

@ -285,6 +285,7 @@ patch_enable_all ()
enable_user32_GetSystemMetrics="$1"
enable_user32_Invalidate_Key_State="$1"
enable_user32_ListBox_Size="$1"
enable_user32_MOUSEHOOKSTRUCTEX="$1"
enable_user32_Mouse_Message_Hwnd="$1"
enable_user32_Refresh_MDI_Menus="$1"
enable_user32_ScrollWindowEx="$1"
@ -968,6 +969,9 @@ patch_enable ()
user32-ListBox_Size)
enable_user32_ListBox_Size="$2"
;;
user32-MOUSEHOOKSTRUCTEX)
enable_user32_MOUSEHOOKSTRUCTEX="$2"
;;
user32-Mouse_Message_Hwnd)
enable_user32_Mouse_Message_Hwnd="$2"
;;
@ -5597,6 +5601,21 @@ if test "$enable_user32_ListBox_Size" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-MOUSEHOOKSTRUCTEX
# |
# | This patchset fixes the following Wine bugs:
# | * [#38314] Pass MOUSEHOOKSTRUCTEX struct to mouse hook callback
# |
# | Modified files:
# | * dlls/user32/message.c
# |
if test "$enable_user32_MOUSEHOOKSTRUCTEX" -eq 1; then
patch_apply user32-MOUSEHOOKSTRUCTEX/0001-user32-Add-MOUSEHOOKSTRUCTEX-to-fix-mouse-wheel-supp.patch
(
echo '+ { "Kira Backes", "user32: Add MOUSEHOOKSTRUCTEX to fix mouse wheel support for JA2 1.13 and other apps which use it.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-Mouse_Message_Hwnd
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,67 @@
From f3a55ca22853088d82f30711f9616b22b20bd228 Mon Sep 17 00:00:00 2001
From: Kira Backes <kira.backes@nrwsoft.de>
Date: Tue, 22 Dec 2015 16:34:41 +0100
Subject: user32: Add MOUSEHOOKSTRUCTEX to fix mouse wheel support for JA2 1.13
and other apps which use it
- Fixes out-of-bounds access for programs which cast to MOUSEHOOKSTRUCTEX (instead of just MOUSEHOOKSTRUCT) on mouse hooks
- Enables mouse wheel support for those programs
- Fixes Bug 38314 (and maybe others?)
Signed-off-by: Kira Backes <kira.backes@nrwsoft.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
dlls/user32/message.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 96e7f2e..b96418f 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2488,8 +2488,12 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
INT hittest;
EVENTMSG event;
GUITHREADINFO info;
- MOUSEHOOKSTRUCT hook;
BOOL eatMsg;
+ struct /* MOUSEHOOKSTRUCTEX */
+ {
+ MOUSEHOOKSTRUCT hook;
+ DWORD mouseData;
+ } hook;
/* find the window to dispatch this mouse message to */
@@ -2584,17 +2588,21 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
/* message is accepted now (but may still get dropped) */
- hook.pt = msg->pt;
- hook.hwnd = msg->hwnd;
- hook.wHitTestCode = hittest;
- hook.dwExtraInfo = extra_info;
+ hook.hook.pt = msg->pt;
+ hook.hook.hwnd = msg->hwnd;
+ hook.hook.wHitTestCode = hittest;
+ hook.hook.dwExtraInfo = extra_info;
+ /* the correct mouseData for the events WM_XBUTTONDOWN, WM_XBUTTONUP, WM_XBUTTONDBLCLK,
+ * WM_NCXBUTTONDOWN, WM_NCXBUTTONUP, and WM_NCXBUTTONDBLCLK is not yet implemented */
+ hook.mouseData = (msg->message == WM_MOUSEWHEEL ? msg->wParam : 0);
if (HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
message, (LPARAM)&hook, TRUE ))
{
- hook.pt = msg->pt;
- hook.hwnd = msg->hwnd;
- hook.wHitTestCode = hittest;
- hook.dwExtraInfo = extra_info;
+ hook.hook.pt = msg->pt;
+ hook.hook.hwnd = msg->hwnd;
+ hook.hook.wHitTestCode = hittest;
+ hook.hook.dwExtraInfo = extra_info;
+ hook.mouseData = (msg->message == WM_MOUSEWHEEL ? msg->wParam : 0);
HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, TRUE );
accept_hardware_message( hw_id, TRUE );
return FALSE;
--
2.6.4

View File

@ -0,0 +1 @@
Fixes: [38314] Pass MOUSEHOOKSTRUCTEX struct to mouse hook callback

View File

@ -4,6 +4,7 @@ wine-staging (1.9.0) UNRELEASED; urgency=low
* Added patch to avoid setting error when NULL is passed to SHMapHandle.
* Added patch to check IsWoW64Process before calling Wow64 functions in
UNIXFS_get_unix_path.
* Added patch to pass MOUSEHOOKSTRUCTEX struct to mouse hook callback.
* Removed patch to add a stub driver for tdi.sys (accepted upstream).
* Removed patch to implement support for ws2_32.dll.WSAPoll (accepted
upstream).