-invented NtUserGetQueueStatus

-added queue bits (currently unused)

svn path=/trunk/; revision=5383
This commit is contained in:
Gunnar Dalsnes 2003-08-02 16:53:08 +00:00
parent 0c6dca9836
commit 7f050c459b
2 changed files with 45 additions and 2 deletions

View file

@ -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 */

View file

@ -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)
{