From d7db5d539998e3528f6435d76874a77336058075 Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Sun, 16 Oct 2011 12:36:48 -0600 Subject: [PATCH] dinput: Don't mask buffer overflow error. --- dlls/dinput/device.c | 2 +- dlls/dinput/mouse.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index a9c7b878eca..75b3cb51039 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -1307,7 +1307,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W ifac } *entries = len; - if (This->overflow) + if (This->overflow && This->dinput->dwVersion == 0x0800) ret = DI_BUFFEROVERFLOW; if (!(flags & DIGDD_PEEK)) diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 011deb0d042..4b65e894927 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -419,7 +419,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM return ret; } -static HRESULT warp_check( SysMouseImpl* This, BOOL force ) +static void warp_check( SysMouseImpl* This, BOOL force ) { DWORD now = GetCurrentTime(); const DWORD interval = This->clipped ? 500 : 10; @@ -430,7 +430,7 @@ static HRESULT warp_check( SysMouseImpl* This, BOOL force ) This->last_warped = now; This->need_warp = FALSE; - if (!GetWindowRect(This->base.win, &rect)) return DIERR_GENERIC; + if (!GetWindowRect(This->base.win, &rect)) return; This->mapped_center.x = (rect.left + rect.right) / 2; This->mapped_center.y = (rect.top + rect.bottom) / 2; if (!This->clipped) @@ -447,7 +447,6 @@ static HRESULT warp_check( SysMouseImpl* This, BOOL force ) This->clipped = GetClipCursor( &new_rect ) && EqualRect( &rect, &new_rect ); } } - return DI_OK; } @@ -569,7 +568,8 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface, } LeaveCriticalSection(&This->base.crit); - return warp_check( This, FALSE ); + warp_check( This, FALSE ); + return DI_OK; } static HRESULT WINAPI SysMouseAImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface, DWORD len, LPVOID ptr) @@ -588,7 +588,7 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W iface, HRESULT res; res = IDirectInputDevice2WImpl_GetDeviceData(iface, dodsize, dod, entries, flags); - if (SUCCEEDED(res)) res = warp_check( This, FALSE ); + if (SUCCEEDED(res)) warp_check( This, FALSE ); return res; }