From d37b69cdc873081fae1be598c6e91db1d53bc4a4 Mon Sep 17 00:00:00 2001 From: Alex Korobka Date: Wed, 14 Oct 1998 18:38:22 +0000 Subject: [PATCH] Better QUEUE_FlushMessages(). --- windows/queue.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/windows/queue.c b/windows/queue.c index 8ab1c80bd92..de5c946b510 100644 --- a/windows/queue.c +++ b/windows/queue.c @@ -435,8 +435,15 @@ void QUEUE_FlushMessages( HQUEUE16 hQueue ) MESSAGEQUEUE *senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask); QSMCTRL* CtrlPtr = queue->smResultCurrent; + TRACE(msg,"Flushing queue %04x:\n", hQueue ); + while( senderQ ) { + if( !CtrlPtr ) + CtrlPtr = senderQ->smResultInit; + + TRACE(msg,"\tfrom queue %04x, smResult %08x\n", queue->hSendingTask, (unsigned)CtrlPtr ); + if( !(queue->hSendingTask = senderQ->hPrevSendingTask) ) queue->wakeBits &= ~QS_SENDMESSAGE; QUEUE_SetWakeBit( senderQ, QS_SMPARAMSFREE ); @@ -448,8 +455,8 @@ void QUEUE_FlushMessages( HQUEUE16 hQueue ) senderQ->smResult = queue->smResultCurrent; QUEUE_SetWakeBit( senderQ, QS_SMRESULT); - if( (senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask)) ) - CtrlPtr = senderQ->smResultInit; + senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask); + CtrlPtr = NULL; } queue->InSendMessageHandle = 0; }