reactos/subsys/win32k/include
diff -u -r1.30 -r1.31
--- msgqueue.h 11 Mar 2004 19:22:21 -0000 1.30
+++ msgqueue.h 7 Apr 2004 21:12:08 -0000 1.31
@@ -50,7 +50,7 @@
/* Queue for hardware messages for the queue. */
LIST_ENTRY HardwareMessagesListHead;
/* Lock for the hardware message list. */
- FAST_MUTEX HardwareLock;
+ KMUTEX HardwareLock;
/* Lock for the queue. */
FAST_MUTEX Lock;
/* Pointer to the current WM_MOUSEMOVE message */
@@ -189,10 +189,10 @@
ExReleaseFastMutex(&MsgQueue->Lock)
#define IntLockHardwareMessageQueue(MsgQueue) \
- ExAcquireFastMutex(&MsgQueue->HardwareLock)
+ KeWaitForMutexObject(&MsgQueue->HardwareLock, UserRequest, KernelMode, FALSE, NULL)
#define IntUnLockHardwareMessageQueue(MsgQueue) \
- ExReleaseFastMutex(&MsgQueue->HardwareLock)
+ KeReleaseMutex(&MsgQueue->HardwareLock, FALSE)
/* check the queue status */
#define MsqIsSignaled(MsgQueue) \
reactos/subsys/win32k/ntuser
diff -u -r1.80 -r1.81
--- msgqueue.c 31 Mar 2004 19:44:34 -0000 1.80
+++ msgqueue.c 7 Apr 2004 21:12:08 -0000 1.81
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: msgqueue.c,v 1.80 2004/03/31 19:44:34 weiden Exp $
+/* $Id: msgqueue.c,v 1.81 2004/04/07 21:12:08 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -906,6 +906,7 @@
LRESULT Result;
PUSER_MESSAGE_QUEUE ThreadQueue;
LARGE_INTEGER Timeout;
+ PLIST_ENTRY Entry;
KeInitializeEvent(&CompletionEvent, NotificationEvent, FALSE);
@@ -944,7 +945,21 @@
WaitStatus = KeWaitForMultipleObjects(2, WaitObjects, WaitAny, UserRequest,
UserMode, FALSE, (uTimeout ? &Timeout : NULL), NULL);
if(WaitStatus == STATUS_TIMEOUT)
- {DbgPrint("MsqSendMessage timed out\n");
+ {
+ IntLockMessageQueue(MessageQueue);
+ Entry = MessageQueue->SentMessagesListHead.Flink;
+ while (Entry != &MessageQueue->SentMessagesListHead)
+ {
+ if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
+ == Message)
+ {
+ Message->CompletionEvent = NULL;
+ break;
+ }
+ Entry = Entry->Flink;
+ }
+ IntUnLockMessageQueue(MessageQueue);
+ DbgPrint("MsqSendMessage timed out\n");
break;
}
while (MsqDispatchOneSentMessage(ThreadQueue))
@@ -1066,7 +1081,7 @@
InitializeListHead(&MessageQueue->PostedMessagesListHead);
InitializeListHead(&MessageQueue->SentMessagesListHead);
InitializeListHead(&MessageQueue->HardwareMessagesListHead);
- ExInitializeFastMutex(&MessageQueue->HardwareLock);
+ KeInitializeMutex(&MessageQueue->HardwareLock, 0);
ExInitializeFastMutex(&MessageQueue->Lock);
MessageQueue->QuitPosted = FALSE;
MessageQueue->QuitExitCode = 0;