diff --git a/reactos/subsys/win32k/ntuser/message.c b/reactos/subsys/win32k/ntuser/message.c index a4f94332563..cf0a6bd1d84 100644 --- a/reactos/subsys/win32k/ntuser/message.c +++ b/reactos/subsys/win32k/ntuser/message.c @@ -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: message.c,v 1.25 2003/07/25 23:53:36 dwelch Exp $ +/* $Id: message.c,v 1.26 2003/08/02 16:53:08 gdalsnes Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -592,4 +592,26 @@ NtUserWaitMessage(VOID) return W32kWaitMessage(NULL, 0, 0); } + +DWORD STDCALL +NtUserGetQueueStatus(BOOL ClearChanges) +{ + PUSER_MESSAGE_QUEUE Queue; + DWORD Result; + + Queue = PsGetWin32Thread()->MessageQueue; + + ExAcquireFastMutex(&Queue->Lock); + + Result = MAKELONG(Queue->ChangedBits, Queue->WakeBits); + if (ClearChanges) + { + Queue->ChangedBits = 0; + } + + ExReleaseFastMutex(&Queue->Lock); + + return Result; +} + /* EOF */ diff --git a/reactos/subsys/win32k/ntuser/msgqueue.c b/reactos/subsys/win32k/ntuser/msgqueue.c index 5e84085090f..2fc706a4a13 100644 --- a/reactos/subsys/win32k/ntuser/msgqueue.c +++ b/reactos/subsys/win32k/ntuser/msgqueue.c @@ -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.12 2003/07/27 11:54:42 dwelch Exp $ +/* $Id: msgqueue.c,v 1.13 2003/08/02 16:53:08 gdalsnes Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -60,6 +60,27 @@ static PAGED_LOOKASIDE_LIST MessageLookasideList; /* FUNCTIONS *****************************************************************/ +/* check the queue status */ +inline BOOL MsqIsSignaled( PUSER_MESSAGE_QUEUE Queue ) +{ + return ((Queue->WakeBits & Queue->WakeMask) || (Queue->ChangedBits & Queue->ChangedMask)); +} + +/* set some queue bits */ +inline VOID MsqSetQueueBits( PUSER_MESSAGE_QUEUE Queue, WORD Bits ) +{ + Queue->WakeBits |= Bits; + Queue->ChangedBits |= Bits; + if (MsqIsSignaled( Queue )) KeSetEvent(&Queue->NewMessages, IO_NO_INCREMENT, FALSE); +} + +/* clear some queue bits */ +inline VOID MsqClearQueueBits( PUSER_MESSAGE_QUEUE Queue, WORD Bits ) +{ + Queue->WakeBits &= ~Bits; + Queue->ChangedBits &= ~Bits; +} + VOID FASTCALL MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue) {