Index: message.c =================================================================== --- message.c (revision 40939) +++ message.c (working copy) @@ -1309,12 +1309,8 @@ PMSGMEMORY MsgMemoryEntry; pti = PsGetCurrentThreadWin32Thread(); - if (WM_QUIT == Msg) + if (Wnd == HWND_BROADCAST) { - MsqPostQuitMessage(pti->MessageQueue, wParam); - } - else if (Wnd == HWND_BROADCAST) - { HWND *List; PWINDOW_OBJECT DesktopWindow; ULONG i; @@ -1345,24 +1341,32 @@ return FALSE; } - UserModeMsg.hwnd = Wnd; - UserModeMsg.message = Msg; - UserModeMsg.wParam = wParam; - UserModeMsg.lParam = lParam; - MsgMemoryEntry = FindMsgMemory(UserModeMsg.message); - Status = CopyMsgToKernelMem(&KernelModeMsg, &UserModeMsg, MsgMemoryEntry); - if (! NT_SUCCESS(Status)) + if (WM_QUIT == Msg) { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; + MsqPostQuitMessage(Window->MessageQueue, wParam); } - IntGetCursorLocation(pti->Desktop->WindowStation, - &KernelModeMsg.pt); - KeQueryTickCount(&LargeTickCount); - pti->timeLast = KernelModeMsg.time = MsqCalculateMessageTime(&LargeTickCount); - MsqPostMessage(Window->MessageQueue, &KernelModeMsg, - NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam, - QS_POSTMESSAGE); + else + { + + UserModeMsg.hwnd = Wnd; + UserModeMsg.message = Msg; + UserModeMsg.wParam = wParam; + UserModeMsg.lParam = lParam; + MsgMemoryEntry = FindMsgMemory(UserModeMsg.message); + Status = CopyMsgToKernelMem(&KernelModeMsg, &UserModeMsg, MsgMemoryEntry); + if (! NT_SUCCESS(Status)) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + IntGetCursorLocation(pti->Desktop->WindowStation, + &KernelModeMsg.pt); + KeQueryTickCount(&LargeTickCount); + pti->timeLast = KernelModeMsg.time = MsqCalculateMessageTime(&LargeTickCount); + MsqPostMessage(Window->MessageQueue, &KernelModeMsg, + NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam, + QS_POSTMESSAGE); + } } return TRUE;