From 269fab698ee38f45e9356ea3edbc5acd415f11ef Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Mon, 18 Jul 2005 15:05:58 +0000 Subject: [PATCH] Removed the message also from the senders queue (in MsqCleanupMessageQueue). svn path=/trunk/; revision=16634 --- reactos/subsys/win32k/ntuser/msgqueue.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/subsys/win32k/ntuser/msgqueue.c b/reactos/subsys/win32k/ntuser/msgqueue.c index d73f33baaf1..2461fd2039d 100644 --- a/reactos/subsys/win32k/ntuser/msgqueue.c +++ b/reactos/subsys/win32k/ntuser/msgqueue.c @@ -1423,6 +1423,13 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) CurrentSentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry); + IntLockMessageQueue(CurrentSentMessage->SenderQueue); + /* remove the message from the dispatching list */ + if(CurrentSentMessage->DispatchingListEntry.Flink != NULL) + { + RemoveEntryList(&CurrentSentMessage->DispatchingListEntry); + } + DPRINT("Notify the sender, the thread has been terminated while dispatching a message!\n"); /* wake the sender's thread */ @@ -1430,7 +1437,8 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) { KeSetEvent(CurrentSentMessage->CompletionEvent, IO_NO_INCREMENT, FALSE); } - + IntUnLockMessageQueue(CurrentSentMessage->SenderQueue); + /* dereference our and the sender's message queue */ IntDereferenceMessageQueue(MessageQueue); IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue);