Skip to content

Commit

Permalink
[WIN32K:NTUSER] Check for NULL desktop window in co_IntProcessMouseMe…
Browse files Browse the repository at this point in the history
…ssage
  • Loading branch information
tkreuzer committed Dec 22, 2024
1 parent 9382aa2 commit 192112d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion win32ss/user/ntuser/msgqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,12 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, BOOL* NotForUs, L

pti = PsGetCurrentThreadWin32Thread();
pwndDesktop = UserGetDesktopWindow();
if (pwndDesktop == NULL)
{
ERR("No desktop window!\n");
return FALSE;
}

MessageQueue = pti->MessageQueue;
CurInfo = IntGetSysCursorInfo();
pwndMsg = ValidateHwndNoErr(msg->hwnd);
Expand Down Expand Up @@ -2001,7 +2007,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti,

UpdateKeyStateFromMsg(MessageQueue, &msg);
AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove, &NotForUs, ExtraInfo, MsgFilterLow, MsgFilterHigh);

if (!NotForUs && (MsgFilterLow != 0 || MsgFilterHigh != 0))
{
/* Don't return message if not in range */
Expand Down

0 comments on commit 192112d

Please sign in to comment.