From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/input.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index a582826d18e..999cce23715 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -841,6 +841,26 @@ SHORT WINAPI NtUserGetAsyncKeyState( INT key ) return ret; }
+/*********************************************************************** + * get_shared_queue_bits + */ +static BOOL get_shared_queue_bits( UINT *wake_bits, UINT *changed_bits ) +{ + struct object_lock lock = OBJECT_LOCK_INIT; + const queue_shm_t *queue_shm; + UINT status; + + *wake_bits = *changed_bits = 0; + while ((status = get_shared_queue( &lock, &queue_shm )) == STATUS_PENDING) + { + *wake_bits = queue_shm->wake_bits; + *changed_bits = queue_shm->changed_bits; + } + + if (status) return FALSE; + return TRUE; +} + /*********************************************************************** * NtUserGetQueueStatus (win32u.@) */ @@ -871,18 +891,12 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags ) */ DWORD get_input_state(void) { - DWORD ret; + UINT wake_bits, changed_bits;
check_for_events( QS_INPUT );
- SERVER_START_REQ( get_queue_status ) - { - req->clear_bits = 0; - wine_server_call( req ); - ret = reply->wake_bits & (QS_KEY | QS_MOUSEBUTTON); - } - SERVER_END_REQ; - return ret; + if (!get_shared_queue_bits( &wake_bits, &changed_bits )) return 0; + return wake_bits & (QS_KEY | QS_MOUSEBUTTON); }
/***********************************************************************