From 011a3523aa2921c03766155e8669e08db4a6989f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 15 Feb 2012 19:13:34 +0100 Subject: [PATCH] dinput: Filter out mouse wheel messages in exclusive mode. --- dlls/dinput/mouse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index f78ae23e08e..7cac0fc5c3f 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -319,7 +319,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM { MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam; SysMouseImpl* This = impl_from_IDirectInputDevice8A(iface); - int wdata = 0, inst_id = -1; + int wdata = 0, inst_id = -1, ret = 0; TRACE("msg %lx @ (%d %d)\n", wparam, hook->pt.x, hook->pt.y); @@ -367,6 +367,9 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM case WM_MOUSEWHEEL: inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Z_AXIS_INSTANCE) | DIDFT_RELAXIS; This->m_state.lZ += wdata = (short)HIWORD(hook->mouseData); + /* FarCry crashes if it gets a mouse wheel message */ + /* FIXME: should probably filter out other messages too */ + ret = This->clipped; break; case WM_LBUTTONDOWN: inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_BUTTONS_INSTANCE + 0) | DIDFT_PSHBUTTON; @@ -411,7 +414,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM } LeaveCriticalSection(&This->base.crit); - return 0; + return ret; } static void warp_check( SysMouseImpl* This, BOOL force ) -- 2.11.4.GIT