mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
fixed MsqInsertSystemMessage()
svn path=/trunk/; revision=5853
This commit is contained in:
parent
9acc460ae1
commit
15ccb1b4be
1 changed files with 14 additions and 9 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: msgqueue.c,v 1.16 2003/08/25 14:26:30 weiden Exp $
|
/* $Id: msgqueue.c,v 1.17 2003/08/25 14:54:06 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -124,12 +124,11 @@ MsqInitializeImpl(VOID)
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
LPMSG FASTCALL
|
ULONG FASTCALL
|
||||||
MsgFindSystemMessage(UINT message)
|
MsgFindSystemMessage(UINT message)
|
||||||
{
|
{
|
||||||
ULONG QueuePos;
|
|
||||||
LPMSG Result = NULL;
|
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
|
ULONG QueuePos, Result = (ULONG)-1;
|
||||||
|
|
||||||
if(SystemMessageQueueCount > 0)
|
if(SystemMessageQueueCount > 0)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +138,7 @@ MsgFindSystemMessage(UINT message)
|
||||||
Msg = SystemMessageQueue[QueuePos];
|
Msg = SystemMessageQueue[QueuePos];
|
||||||
if(Msg.message == message)
|
if(Msg.message == message)
|
||||||
{
|
{
|
||||||
Result = &Msg;
|
Result = QueuePos;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QueuePos--;
|
QueuePos--;
|
||||||
|
@ -153,7 +152,7 @@ VOID FASTCALL
|
||||||
MsqInsertSystemMessage(MSG* Msg)
|
MsqInsertSystemMessage(MSG* Msg)
|
||||||
{
|
{
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
LPMSG mmov = NULL;
|
ULONG mmov = (ULONG)-1;
|
||||||
|
|
||||||
KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
|
KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
|
||||||
|
|
||||||
|
@ -161,10 +160,16 @@ MsqInsertSystemMessage(MSG* Msg)
|
||||||
if(Msg->message == WM_MOUSEMOVE)
|
if(Msg->message == WM_MOUSEMOVE)
|
||||||
mmov = MsgFindSystemMessage(WM_MOUSEMOVE);
|
mmov = MsgFindSystemMessage(WM_MOUSEMOVE);
|
||||||
|
|
||||||
if(mmov)
|
if(mmov != (ULONG)-1)
|
||||||
{
|
{
|
||||||
/* overwrite the existing WM_MOUSEMOVE message */
|
/* remove old WM_MOUSEMOVE message, move previous messages and insert
|
||||||
*mmov = *Msg;
|
new WM_MOUSEMOVE message at the queue head */
|
||||||
|
while(mmov > SystemMessageQueueHead)
|
||||||
|
{
|
||||||
|
SystemMessageQueue[mmov - 1] = SystemMessageQueue[mmov];
|
||||||
|
mmov--;
|
||||||
|
}
|
||||||
|
SystemMessageQueue[SystemMessageQueueHead] = *Msg;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue