UserEnterCo();
- if (WaitStatus == STATUS_TIMEOUT || WaitStatus == STATUS_USER_APC)
+ if (WaitStatus == STATUS_TIMEOUT)
{
/* Look up if the message has not yet dispatched, if so
make sure it can't pass a result and it must not set the completion event anymore */
and the message is still hasn't been dispatched */
Message->CompletionEvent = NULL;
Message->Result = NULL;
+ RemoveEntryList(&Message->ListEntry);
+ ClearMsgBitsMask(ptirec, Message->QS_Flags);
+ ExFreePoolWithTag(Message, TAG_USRMSG);
break;
}
Entry = Entry->Flink;
UserEnterCo();
- if (WaitStatus == STATUS_TIMEOUT || WaitStatus == STATUS_USER_APC)
+ if (WaitStatus == STATUS_TIMEOUT)
{
/* Look up if the message has not yet been dispatched, if so
make sure it can't pass a result and it must not set the completion event anymore */
and the message is still hasn't been dispatched */
Message->CompletionEvent = NULL;
Message->Result = NULL;
+ RemoveEntryList(&Message->ListEntry);
+ ClearMsgBitsMask(ptirec, Message->QS_Flags);
+ ExFreePoolWithTag(Message, TAG_USRMSG);
break;
}
Entry = Entry->Flink;
Entry = Entry->Flink;
}
}
+
+ if (WaitStatus == STATUS_USER_APC) break;
+
while (co_MsqDispatchOneSentMessage(pti))
;
}