From 7ee6f8e15bd67098a585c0ce241b3a7e6cd47c01 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 18 May 2011 19:38:40 +0200 Subject: Don't clear the dinput queue in IDirectInputDevice2WImpl_Acquire Only append messages to the dinput queue as long as IDirectInputDevice is acquired --- dlls/dinput/device.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 397e70e..0af1c8b 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -559,7 +559,7 @@ void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD tim /* Event is being set regardless of the queue state */ if (This->hEvent) SetEvent(This->hEvent); - if (!This->queue_len || This->overflow || ofs < 0) return; + if (!This->queue_len || This->overflow || ofs < 0 || !This->acquired) return; next_pos = (This->queue_head + 1) % This->queue_len; if (next_pos == This->queue_tail) @@ -598,7 +598,6 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Acquire(LPDIRECTINPUTDEVICE8W iface) This->acquired = 1; if (res == DI_OK) { - This->queue_head = This->queue_tail = This->overflow = 0; check_dinput_hooks(iface); } LeaveCriticalSection(&This->crit); @@ -956,6 +955,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty( This->data_format.user_df->dwFlags &= ~DIDFT_AXIS; This->data_format.user_df->dwFlags |= pd->dwData == DIPROPAXISMODE_ABS ? DIDF_ABSAXIS : DIDF_RELAXIS; + This->queue_head = This->queue_tail = This->overflow = 0; LeaveCriticalSection(&This->crit); break; } -- 1.7.4.1