mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTUSER] Improve MsqPostMessage (#5225)
- MsqPostMessage: Fill Message structure before InsertTailList. For style consistency. - MsqPostMessage: Fix the use of MessageQueue variable
This commit is contained in:
parent
d3feae5139
commit
560671a784
1 changed files with 13 additions and 11 deletions
|
@ -1344,18 +1344,25 @@ MsqPostMessage(PTHREADINFO pti,
|
|||
PUSER_MESSAGE Message;
|
||||
PUSER_MESSAGE_QUEUE MessageQueue;
|
||||
|
||||
if ( pti->TIF_flags & TIF_INCLEANUP || pti->MessageQueue->QF_flags & QF_INDESTROY )
|
||||
MessageQueue = pti->MessageQueue;
|
||||
|
||||
if ((pti->TIF_flags & TIF_INCLEANUP) || (MessageQueue->QF_flags & QF_INDESTROY))
|
||||
{
|
||||
ERR("Post Msg; Thread or Q is Dead!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(Message = MsqCreateMessage(Msg)))
|
||||
{
|
||||
Message = MsqCreateMessage(Msg);
|
||||
if (!Message)
|
||||
return;
|
||||
}
|
||||
|
||||
MessageQueue = pti->MessageQueue;
|
||||
if (Msg->message == WM_HOTKEY)
|
||||
MessageBits |= QS_HOTKEY;
|
||||
|
||||
Message->dwQEvent = dwQEvent;
|
||||
Message->ExtraInfo = ExtraInfo;
|
||||
Message->QS_Flags = MessageBits;
|
||||
Message->pti = pti;
|
||||
|
||||
if (!HardwareMessage)
|
||||
{
|
||||
|
@ -1366,13 +1373,8 @@ MsqPostMessage(PTHREADINFO pti,
|
|||
InsertTailList(&MessageQueue->HardwareMessagesListHead, &Message->ListEntry);
|
||||
}
|
||||
|
||||
if (Msg->message == WM_HOTKEY) MessageBits |= QS_HOTKEY; // Justin Case, just set it.
|
||||
Message->dwQEvent = dwQEvent;
|
||||
Message->ExtraInfo = ExtraInfo;
|
||||
Message->QS_Flags = MessageBits;
|
||||
Message->pti = pti;
|
||||
MsqWakeQueue(pti, MessageBits, TRUE);
|
||||
TRACE("Post Message %d\n",PostMsgCount);
|
||||
TRACE("Post Message %d\n", PostMsgCount);
|
||||
}
|
||||
|
||||
VOID FASTCALL
|
||||
|
|
Loading…
Reference in a new issue