[NTUSER] Fix PeekMessageA for MsgFilterLow/High mouse clicks (#6427)

Fix MSO and Word Viewer not closing when "X" on title bar is clicked.
This is another @I_Kill_Bugs patch.

CORE-14436 , CORE-16985
This commit is contained in:
Doug Lyons 2024-03-11 08:34:34 -05:00 committed by GitHub
parent acb01cf568
commit c17a6542ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1986,8 +1986,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti,
( Window == PWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
( Window != PWND_BOTTOM && UserHMGetHandle(Window) == CurrentMessage->Msg.hwnd ) || // 3
( is_mouse_message(CurrentMessage->Msg.message) ) ) && // Null window for anything mouse.
( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) ||
( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
( CurrentMessage->QS_Flags & QSflags ) )
{
idSave = MessageQueue->idSysPeek;
MessageQueue->idSysPeek = (ULONG_PTR)CurrentMessage;
@ -2000,6 +1999,13 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti,
UpdateKeyStateFromMsg(MessageQueue, &msg);
AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove, &NotForUs, ExtraInfo, MsgFilterLow, MsgFilterHigh);
if (MsgFilterLow != 0 || MsgFilterHigh != 0)
{
/* Don't return message if not in range */
if (msg.message < MsgFilterLow || msg.message > MsgFilterHigh)
AcceptMessage = FALSE;
}
if (Remove)
{