static PPAGED_LOOKASIDE_LIST pgMessageLookasideList;
static PPAGED_LOOKASIDE_LIST pgSendMsgLookasideList;
+INT PostMsgCount = 0;
INT SendMsgCount = 0;
PUSER_MESSAGE_QUEUE gpqCursor;
ULONG_PTR gdwMouseMoveExtraInfo = 0;
RtlZeroMemory(Message, sizeof(*Message));
RtlMoveMemory(&Message->Msg, Msg, sizeof(MSG));
-
+ PostMsgCount++;
return Message;
}
VOID FASTCALL
MsqDestroyMessage(PUSER_MESSAGE Message)
{
+ TRACE("Post Destroy %d\n",PostMsgCount)
if (Message->pti == NULL)
{
ERR("Double Free Message\n");
return;
}
+ RemoveEntryList(&Message->ListEntry);
Message->pti = NULL;
ExFreeToPagedLookasideList(pgMessageLookasideList, Message);
+ PostMsgCount--;
}
PUSER_SENT_MESSAGE FASTCALL
pti->QuitPosted = 1;
pti->exitCode = PostedMessage->Msg.wParam;
}
- RemoveEntryList(&PostedMessage->ListEntry);
ClearMsgBitsMask(pti, PostedMessage->QS_Flags);
MsqDestroyMessage(PostedMessage);
CurrentEntry = pti->PostedMessagesListHead.Flink;
Message->QS_Flags = MessageBits;
Message->pti = pti;
MsqWakeQueue(pti, MessageBits, TRUE);
+ TRACE("Post Message %d\n",PostMsgCount);
}
VOID FASTCALL
}
}
-BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, BOOL* NotForUs, UINT first, UINT last)
+BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, BOOL* NotForUs, LONG_PTR ExtraInfo, UINT first, UINT last)
{
MSG clk_msg;
POINT pt;
}
}
+ if (pti->TIF_flags & TIF_MSGPOSCHANGED)
+ {
+ pti->TIF_flags &= ~TIF_MSGPOSCHANGED;
+ IntNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, NULL, OBJID_CLIENT, CHILDID_SELF, 0);
+ }
+
/* message is accepted now (but still get dropped) */
event.message = msg->message;
hook.pt = msg->pt;
hook.hwnd = msg->hwnd;
hook.wHitTestCode = hittest;
- hook.dwExtraInfo = 0 /* extra_info */ ;
+ hook.dwExtraInfo = ExtraInfo;
if (co_HOOK_CallHooks( WH_MOUSE, *RemoveMessages ? HC_ACTION : HC_NOREMOVE,
message, (LPARAM)&hook ))
{
hook.pt = msg->pt;
hook.hwnd = msg->hwnd;
hook.wHitTestCode = hittest;
- hook.dwExtraInfo = 0 /* extra_info */ ;
+ hook.dwExtraInfo = ExtraInfo;
co_HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook );
ERR("WH_MOUSE dropped mouse message!\n");
return Ret;
}
-BOOL co_IntProcessHardwareMessage(MSG* Msg, BOOL* RemoveMessages, BOOL* NotForUs, UINT first, UINT last)
+BOOL co_IntProcessHardwareMessage(MSG* Msg, BOOL* RemoveMessages, BOOL* NotForUs, LONG_PTR ExtraInfo, UINT first, UINT last)
{
if ( IS_MOUSE_MESSAGE(Msg->message))
{
- return co_IntProcessMouseMessage(Msg, RemoveMessages, NotForUs, first, last);
+ return co_IntProcessMouseMessage(Msg, RemoveMessages, NotForUs, ExtraInfo, first, last);
}
else if ( IS_KBD_MESSAGE(Msg->message))
{
MSG msg;
ULONG_PTR idSave;
DWORD QS_Flags;
+ LONG_PTR ExtraInfo;
BOOL Ret = FALSE;
PUSER_MESSAGE_QUEUE MessageQueue = pti->MessageQueue;
MessageQueue->idSysPeek = (ULONG_PTR)CurrentMessage;
msg = CurrentMessage->Msg;
+ ExtraInfo = CurrentMessage->ExtraInfo;
QS_Flags = CurrentMessage->QS_Flags;
NotForUs = FALSE;
UpdateKeyStateFromMsg(MessageQueue, &msg);
- AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove, &NotForUs, MsgFilterLow, MsgFilterHigh);
+ AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove, &NotForUs, ExtraInfo, MsgFilterLow, MsgFilterHigh);
if (Remove)
{
- if (CurrentMessage->pti != NULL)
+ if (CurrentMessage->pti != NULL && (MessageQueue->idSysPeek == (ULONG_PTR)CurrentMessage))
{
- RemoveEntryList(&CurrentMessage->ListEntry);
MsqDestroyMessage(CurrentMessage);
}
ClearMsgBitsMask(pti, QS_Flags);
}
pti->ptLast = msg.pt;
pti->timeLast = msg.time;
- //MessageQueue->ExtraInfo = ExtraInfo;
+ MessageQueue->ExtraInfo = ExtraInfo;
Ret = TRUE;
break;
}
{
if (CurrentMessage->pti != NULL)
{
- RemoveEntryList(&CurrentMessage->ListEntry);
MsqDestroyMessage(CurrentMessage);
}
ClearMsgBitsMask(pti, QS_Flags);
/* cleanup posted messages */
while (!IsListEmpty(&pti->PostedMessagesListHead))
{
- CurrentEntry = RemoveHeadList(&pti->PostedMessagesListHead);
+ CurrentEntry = pti->PostedMessagesListHead.Flink;
CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry);
+ ERR("Thread Cleanup Post Messages %p\n",CurrentMessage);
if (CurrentMessage->dwQEvent)
{
if (CurrentMessage->dwQEvent == POSTEVENT_NWE)
MsqCleanupMessageQueue(PTHREADINFO pti)
{
PUSER_MESSAGE_QUEUE MessageQueue;
+ PLIST_ENTRY CurrentEntry;
+ PUSER_MESSAGE CurrentMessage;
MessageQueue = pti->MessageQueue;
MessageQueue->cThreads--;
if (MessageQueue->ptiSysLock == pti) MessageQueue->ptiSysLock = NULL;
}
+ if (MessageQueue->cThreads == 0) //// Fix a crash related to CORE-10471 testing.
+ {
+ /* cleanup posted messages */
+ while (!IsListEmpty(&MessageQueue->HardwareMessagesListHead))
+ {
+ CurrentEntry = MessageQueue->HardwareMessagesListHead.Flink;
+ CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry);
+ ERR("MQ Cleanup Post Messages %p\n",CurrentMessage);
+ MsqDestroyMessage(CurrentMessage);
+ }
+ } ////
+
if (MessageQueue->CursorObject)
{
PCURICON_OBJECT pCursor = MessageQueue->CursorObject;