win32ss/user/ntuser/msgqueue.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/win32ss/user/ntuser/msgqueue.c b/win32ss/user/ntuser/msgqueue.c index b704dbce5ca..b08fe917592 100644 --- a/win32ss/user/ntuser/msgqueue.c +++ b/win32ss/user/ntuser/msgqueue.c @@ -1946,6 +1946,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti, DWORD QS_Flags; LONG_PTR ExtraInfo; BOOL Ret = FALSE; + MSG clk_msg; PUSER_MESSAGE_QUEUE MessageQueue = pti->MessageQueue; if (!filter_contains_hw_range( MsgFilterLow, MsgFilterHigh )) return FALSE; @@ -1994,17 +1995,22 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti, msg = CurrentMessage->Msg; ExtraInfo = CurrentMessage->ExtraInfo; QS_Flags = CurrentMessage->QS_Flags; + clk_msg = MessageQueue->msgDblClk; NotForUs = FALSE; UpdateKeyStateFromMsg(MessageQueue, &msg); AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove, &NotForUs, ExtraInfo, MsgFilterLow, MsgFilterHigh); - if (MsgFilterLow != 0 || MsgFilterHigh != 0) + if (!NotForUs && (MsgFilterLow != 0 || MsgFilterHigh != 0)) { /* Don't return message if not in range */ if (msg.message < MsgFilterLow || msg.message > MsgFilterHigh) - AcceptMessage = FALSE; + { + MessageQueue->msgDblClk = clk_msg; + MessageQueue->idSysPeek = idSave; + continue; + } } if (Remove)