From c4915f13f155548739b6f8090b307f98896db04b Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Mon, 28 Jun 2010 12:05:49 +0000 Subject: [PATCH] [win32k] - Only the CompletionCallback member determines if a callback is needed. Checking the SenderReturn is unwanted and this variable was never initialized which could cause bogus callback attempts. Just remove the BOOL variable SenderReturned and directly check if Message->DispatchingListEntry.Flink is NULL before attempting to remove the message from senders queue. Noticed by Timo. svn path=/trunk/; revision=47895 --- reactos/subsystems/win32/win32k/ntuser/msgqueue.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index 1bba2a19929..52587ac7946 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -893,7 +893,6 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) PUSER_SENT_MESSAGE Message; PLIST_ENTRY Entry; LRESULT Result; - BOOL SenderReturned; if (IsListEmpty(&MessageQueue->SentMessagesListHead)) { @@ -921,7 +920,7 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) Result = co_EVENT_CallEvents( Message->Msg.message, Message->Msg.hwnd, Message->Msg.wParam, - Message->Msg.lParam); + Message->Msg.lParam); } else { @@ -939,8 +938,7 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) /* remove the message from the dispatching list if needed, so lock the sender's message queue */ if (!(Message->HookMessage & MSQ_SENTNOWAIT)) { - SenderReturned = (Message->DispatchingListEntry.Flink == NULL); - if (!SenderReturned) + if (Message->DispatchingListEntry.Flink != NULL) { /* only remove it from the dispatching list if not already removed by a timeout */ RemoveEntryList(&Message->DispatchingListEntry); @@ -968,7 +966,7 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) } /* Call the callback if the message was sent with SendMessageCallback */ - if (!SenderReturned && Message->CompletionCallback != NULL) + if (Message->CompletionCallback != NULL) { co_IntCallSentMessageCallback(Message->CompletionCallback, Message->Msg.hwnd, -- 2.17.1