Author: dchapyshev
Date: Fri Jul 3 13:37:44 2009
New Revision: 41754
URL:
http://svn.reactos.org/svn/reactos?rev=41754&view=rev
Log:
- Use PWINDOW_OBJECT instead HWND in PostTimerMessages, IntGetPaintMessage,
co_MsqTranslateMouseMessage, co_MsqPeekHardwareMessage, co_MsqFindMessage,
co_MsqWaitForNewMessages, MsqGetTimerMessage, MsqGetFirstTimerExpiry, co_IntPeekMessage
- Allow hWnd equal -1, 0x0000ffff, 0xffffffff
- Fixes 3 winetests for PeekMessageA/W
Modified:
trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
trunk/reactos/subsystems/win32/win32k/include/painting.h
trunk/reactos/subsystems/win32/win32k/include/timer.h
trunk/reactos/subsystems/win32/win32k/include/winsta.h
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Fri Jul 3
13:37:44 2009
@@ -139,7 +139,7 @@
co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
- IN HWND Wnd,
+ IN PWINDOW_OBJECT Window,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message);
@@ -158,7 +158,7 @@
BOOLEAN FASTCALL
co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS FASTCALL
-co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, HWND WndFilter,
+co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
UINT MsgFilterMin, UINT MsgFilterMax);
VOID FASTCALL
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
@@ -262,11 +262,11 @@
UINT_PTR IDEvent, UINT Msg);
BOOLEAN FASTCALL
MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
- HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ PWINDOW_OBJECT WindowFilter, UINT MsgFilterMin, UINT MsgFilterMax,
MSG *Msg, BOOLEAN Restart);
BOOLEAN FASTCALL
MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
- HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ PWINDOW_OBJECT WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
PLARGE_INTEGER FirstTimerExpiry);
VOID FASTCALL
MsqRemoveTimersWindow(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd);
Modified: trunk/reactos/subsystems/win32/win32k/include/painting.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/painting.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/painting.h [iso-8859-1] Fri Jul 3
13:37:44 2009
@@ -10,7 +10,7 @@
VOID FASTCALL
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
BOOL FASTCALL
-IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
+IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax,
PTHREADINFO Thread,
MSG *Message, BOOL Remove);
INT FASTCALL UserRealizePalette(HDC);
INT FASTCALL co_UserGetUpdateRgn(PWINDOW_OBJECT, HRGN, BOOL);
Modified: trunk/reactos/subsystems/win32/win32k/include/timer.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/timer.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/timer.h [iso-8859-1] Fri Jul 3 13:37:44
2009
@@ -33,7 +33,7 @@
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,PWINDOW_OBJECT,WPARAM,LPARAM);
VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
UINT_PTR FASTCALL SetSystemTimer(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC);
-BOOL FASTCALL PostTimerMessages(HWND);
+BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT);
VOID FASTCALL ProcessTimers(VOID);
VOID FASTCALL StartTheTimers(VOID);
Modified: trunk/reactos/subsystems/win32/win32k/include/winsta.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/winsta.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/winsta.h [iso-8859-1] Fri Jul 3
13:37:44 2009
@@ -1,7 +1,7 @@
#ifndef _WIN32K_WINSTA_H
#define _WIN32K_WINSTA_H
-#include "msgqueue.h"
+#include "window.h"
#include "clipboard.h"
#define WINSTA_ROOT_NAME L"\\Windows\\WindowStations"
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Fri Jul 3
13:37:44 2009
@@ -739,7 +739,7 @@
*/
BOOL FASTCALL
co_IntPeekMessage(PUSER_MESSAGE Msg,
- HWND hWnd,
+ PWINDOW_OBJECT Window,
UINT MsgFilterMin,
UINT MsgFilterMax,
UINT RemoveMsg)
@@ -796,7 +796,7 @@
Present = co_MsqFindMessage(ThreadQueue,
FALSE,
RemoveMessages,
- hWnd,
+ Window,
MsgFilterMin,
MsgFilterMax,
&Message);
@@ -814,7 +814,7 @@
Present = co_MsqFindMessage(ThreadQueue,
TRUE,
RemoveMessages,
- hWnd,
+ Window,
MsgFilterMin,
MsgFilterMax,
&Message);
@@ -833,19 +833,19 @@
;
/* Check for paint messages. */
- if (IntGetPaintMessage(hWnd, MsgFilterMin, MsgFilterMax, pti, &Msg->Msg,
RemoveMessages))
+ if (IntGetPaintMessage(Window, MsgFilterMin, MsgFilterMax, pti, &Msg->Msg,
RemoveMessages))
{
Msg->FreeLParam = FALSE;
goto MsgExit;
}
if (ThreadQueue->WakeMask & QS_TIMER)
- if (PostTimerMessages(hWnd)) // If there are timers ready,
+ if (PostTimerMessages(Window)) // If there are timers ready,
goto CheckMessages; // go back and process them.
// LOL! Polling Timer Queue? How much time is spent doing this?
/* Check for WM_(SYS)TIMER messages */
- Present = MsqGetTimerMessage(ThreadQueue, hWnd, MsgFilterMin, MsgFilterMax,
+ Present = MsqGetTimerMessage(ThreadQueue, Window, MsgFilterMin, MsgFilterMax,
&Msg->Msg, RemoveMessages);
if (Present)
{
@@ -989,13 +989,20 @@
DPRINT("Enter NtUserPeekMessage\n");
UserEnterExclusive();
+ if (hWnd == (HWND)-1 || hWnd == (HWND)0x0000FFFF || hWnd == (HWND)0xFFFFFFFF)
+ hWnd = (HWND)1;
+
/* Validate input */
- if (hWnd && hWnd != INVALID_HANDLE_VALUE)
+ if (hWnd && hWnd != (HWND)1)
{
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN(-1);
}
+ }
+ else
+ {
+ Window = (PWINDOW_OBJECT)hWnd;
}
if (MsgFilterMax < MsgFilterMin)
@@ -1004,7 +1011,7 @@
MsgFilterMax = 0;
}
- Present = co_IntPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, RemoveMsg);
+ Present = co_IntPeekMessage(&Msg, Window, MsgFilterMin, MsgFilterMax, RemoveMsg);
if (Present)
{
@@ -1063,7 +1070,7 @@
}
static BOOL FASTCALL
-co_IntWaitMessage(HWND Wnd,
+co_IntWaitMessage(PWINDOW_OBJECT Window,
UINT MsgFilterMin,
UINT MsgFilterMax)
{
@@ -1077,13 +1084,13 @@
do
{
- if (co_IntPeekMessage(&Msg, Wnd, MsgFilterMin, MsgFilterMax, PM_NOREMOVE))
+ if (co_IntPeekMessage(&Msg, Window, MsgFilterMin, MsgFilterMax, PM_NOREMOVE))
{
return TRUE;
}
/* Nothing found. Wait for new messages. */
- Status = co_MsqWaitForNewMessages(ThreadQueue, Wnd, MsgFilterMin, MsgFilterMax);
+ Status = co_MsqWaitForNewMessages(ThreadQueue, Window, MsgFilterMin,
MsgFilterMax);
}
while ((STATUS_WAIT_0 <= Status && Status <= STATUS_WAIT_63) ||
STATUS_TIMEOUT == Status);
@@ -1139,7 +1146,7 @@
do
{
- GotMessage = co_IntPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax,
PM_REMOVE);
+ GotMessage = co_IntPeekMessage(&Msg, Window, MsgFilterMin, MsgFilterMax,
PM_REMOVE);
if (GotMessage)
{
Info.Msg = Msg.Msg;
@@ -1188,7 +1195,7 @@
RETURN( (BOOL) -1);
}
}
- else if (! co_IntWaitMessage(hWnd, MsgFilterMin, MsgFilterMax))
+ else if (! co_IntWaitMessage(Window, MsgFilterMin, MsgFilterMax))
{
RETURN( (BOOL) -1);
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Fri Jul 3
13:37:44 2009
@@ -296,12 +296,12 @@
}
static BOOL APIENTRY
-co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT FilterLow,
UINT FilterHigh,
+co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window, UINT
FilterLow, UINT FilterHigh,
PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
PWINDOW_OBJECT ScopeWin, PPOINT ScreenPoint, BOOL
FromGlobalQueue, PLIST_ENTRY *Next)
{
USHORT Msg = Message->Msg.message;
- PWINDOW_OBJECT Window = NULL;
+ PWINDOW_OBJECT CaptureWindow = NULL;
HWND hCaptureWin;
ASSERT_REFS_CO(ScopeWin);
@@ -315,18 +315,18 @@
hCaptureWin = IntGetCaptureWindow();
if (hCaptureWin == NULL)
{
- if(Msg == WM_MOUSEWHEEL)
- {
- Window = UserGetWindowObject(IntGetFocusWindow());
- if (Window) UserReferenceObject(Window);
+ if (Msg == WM_MOUSEWHEEL)
+ {
+ CaptureWindow = UserGetWindowObject(IntGetFocusWindow());
+ if (CaptureWindow) UserReferenceObject(CaptureWindow);
}
else
{
- co_WinPosWindowFromPoint(ScopeWin, NULL, &Message->Msg.pt, &Window);
- if(Window == NULL)
+ co_WinPosWindowFromPoint(ScopeWin, NULL, &Message->Msg.pt,
&CaptureWindow);
+ if(CaptureWindow == NULL)
{
- Window = ScopeWin;
- if (Window) UserReferenceObject(Window);
+ CaptureWindow = ScopeWin;
+ if (CaptureWindow) UserReferenceObject(CaptureWindow);
}
else
{
@@ -339,13 +339,13 @@
{
/* FIXME - window messages should go to the right window if no buttons are
pressed */
- Window = UserGetWindowObject(hCaptureWin);
- if (Window) UserReferenceObject(Window);
- }
-
-
-
- if (Window == NULL)
+ CaptureWindow = UserGetWindowObject(hCaptureWin);
+ if (CaptureWindow) UserReferenceObject(CaptureWindow);
+ }
+
+
+
+ if (CaptureWindow == NULL)
{
if(!FromGlobalQueue)
{
@@ -361,7 +361,7 @@
return(FALSE);
}
- if (Window->MessageQueue != MessageQueue)
+ if (CaptureWindow->MessageQueue != MessageQueue)
{
if (! FromGlobalQueue)
{
@@ -384,37 +384,37 @@
/* lock the destination message queue, so we don't get in trouble with other
threads, messing with it at the same time */
- IntLockHardwareMessageQueue(Window->MessageQueue);
- InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
+ IntLockHardwareMessageQueue(CaptureWindow->MessageQueue);
+ InsertTailList(&CaptureWindow->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
if(Message->Msg.message == WM_MOUSEMOVE)
{
- if(Window->MessageQueue->MouseMoveMsg)
+ if(CaptureWindow->MessageQueue->MouseMoveMsg)
{
/* remove the old WM_MOUSEMOVE message, we're processing a more recent
one */
-
RemoveEntryList(&Window->MessageQueue->MouseMoveMsg->ListEntry);
- ExFreePool(Window->MessageQueue->MouseMoveMsg);
+
RemoveEntryList(&CaptureWindow->MessageQueue->MouseMoveMsg->ListEntry);
+ ExFreePool(CaptureWindow->MessageQueue->MouseMoveMsg);
}
/* save the pointer to the WM_MOUSEMOVE message in the new queue */
- Window->MessageQueue->MouseMoveMsg = Message;
-
- Window->MessageQueue->QueueBits |= QS_MOUSEMOVE;
- Window->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
- if (Window->MessageQueue->WakeMask & QS_MOUSEMOVE)
- KeSetEvent(Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ CaptureWindow->MessageQueue->MouseMoveMsg = Message;
+
+ CaptureWindow->MessageQueue->QueueBits |= QS_MOUSEMOVE;
+ CaptureWindow->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
+ if (CaptureWindow->MessageQueue->WakeMask & QS_MOUSEMOVE)
+ KeSetEvent(CaptureWindow->MessageQueue->NewMessages, IO_NO_INCREMENT,
FALSE);
}
else
{
- Window->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
- Window->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
- if (Window->MessageQueue->WakeMask & QS_MOUSEBUTTON)
- KeSetEvent(Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
- }
- IntUnLockHardwareMessageQueue(Window->MessageQueue);
+ CaptureWindow->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
+ CaptureWindow->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
+ if (CaptureWindow->MessageQueue->WakeMask & QS_MOUSEBUTTON)
+ KeSetEvent(CaptureWindow->MessageQueue->NewMessages, IO_NO_INCREMENT,
FALSE);
+ }
+ IntUnLockHardwareMessageQueue(CaptureWindow->MessageQueue);
*Freed = FALSE;
- UserDereferenceObject(Window);
+ UserDereferenceObject(CaptureWindow);
return(FALSE);
}
@@ -422,7 +422,7 @@
*ScreenPoint = Message->Msg.pt;
- if((hWnd != NULL && Window->hSelf != hWnd) ||
+ if((Window != NULL && (int)Window != 1 && CaptureWindow->hSelf !=
Window->hSelf) ||
((FilterLow != 0 || FilterHigh != 0) && (Msg < FilterLow || Msg >
FilterHigh)))
{
/* Reject the message because it doesn't match the filter */
@@ -432,21 +432,21 @@
/* Lock the message queue so no other thread can mess with it.
Our own message queue is not locked while fetching from the global
queue, so we have to make sure nothing interferes! */
- IntLockHardwareMessageQueue(Window->MessageQueue);
+ IntLockHardwareMessageQueue(CaptureWindow->MessageQueue);
/* if we're from the global queue, we need to add our message to our
private queue so we don't loose it! */
- InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
+
InsertTailList(&CaptureWindow->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
}
if (Message->Msg.message == WM_MOUSEMOVE)
{
- if(Window->MessageQueue->MouseMoveMsg &&
- (Window->MessageQueue->MouseMoveMsg != Message))
+ if(CaptureWindow->MessageQueue->MouseMoveMsg &&
+ (CaptureWindow->MessageQueue->MouseMoveMsg != Message))
{
/* delete the old message */
-
RemoveEntryList(&Window->MessageQueue->MouseMoveMsg->ListEntry);
- ExFreePool(Window->MessageQueue->MouseMoveMsg);
+
RemoveEntryList(&CaptureWindow->MessageQueue->MouseMoveMsg->ListEntry);
+ ExFreePool(CaptureWindow->MessageQueue->MouseMoveMsg);
if (!FromGlobalQueue)
{
// We might have deleted the next one in our queue, so fix next
@@ -455,20 +455,20 @@
}
/* always save a pointer to this WM_MOUSEMOVE message here because we're
sure that the message is in the private queue */
- Window->MessageQueue->MouseMoveMsg = Message;
+ CaptureWindow->MessageQueue->MouseMoveMsg = Message;
}
if(FromGlobalQueue)
{
- IntUnLockHardwareMessageQueue(Window->MessageQueue);
- }
-
- UserDereferenceObject(Window);
+ IntUnLockHardwareMessageQueue(CaptureWindow->MessageQueue);
+ }
+
+ UserDereferenceObject(CaptureWindow);
*Freed = FALSE;
return(FALSE);
}
/* FIXME - only assign if removing? */
- Message->Msg.hwnd = Window->hSelf;
+ Message->Msg.hwnd = CaptureWindow->hSelf;
Message->Msg.message = Msg;
Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y);
@@ -482,32 +482,32 @@
/* Lock the message queue so no other thread can mess with it.
Our own message queue is not locked while fetching from the global
queue, so we have to make sure nothing interferes! */
- IntLockHardwareMessageQueue(Window->MessageQueue);
- if(Window->MessageQueue->MouseMoveMsg)
+ IntLockHardwareMessageQueue(CaptureWindow->MessageQueue);
+ if(CaptureWindow->MessageQueue->MouseMoveMsg)
{
/* delete the WM_(NC)MOUSEMOVE message in the private queue, we're
dealing
with one that's been sent later */
-
RemoveEntryList(&Window->MessageQueue->MouseMoveMsg->ListEntry);
- ExFreePool(Window->MessageQueue->MouseMoveMsg);
+
RemoveEntryList(&CaptureWindow->MessageQueue->MouseMoveMsg->ListEntry);
+ ExFreePool(CaptureWindow->MessageQueue->MouseMoveMsg);
/* our message is not in the private queue so we can remove the pointer
instead of setting it to the current message we're processing */
- Window->MessageQueue->MouseMoveMsg = NULL;
+ CaptureWindow->MessageQueue->MouseMoveMsg = NULL;
}
- IntUnLockHardwareMessageQueue(Window->MessageQueue);
- }
- else if(Window->MessageQueue->MouseMoveMsg == Message)
- {
- Window->MessageQueue->MouseMoveMsg = NULL;
- }
- }
-
- UserDereferenceObject(Window);
+ IntUnLockHardwareMessageQueue(CaptureWindow->MessageQueue);
+ }
+ else if (CaptureWindow->MessageQueue->MouseMoveMsg == Message)
+ {
+ CaptureWindow->MessageQueue->MouseMoveMsg = NULL;
+ }
+ }
+
+ UserDereferenceObject(CaptureWindow);
*Freed = FALSE;
return(TRUE);
}
BOOL APIENTRY
-co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
+co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window,
UINT FilterLow, UINT FilterHigh, BOOL Remove,
PUSER_MESSAGE* Message)
{
@@ -563,7 +563,7 @@
{
- Accept = co_MsqTranslateMouseMessage(MessageQueue, hWnd, FilterLow, FilterHigh,
+ Accept = co_MsqTranslateMouseMessage(MessageQueue, Window, FilterLow,
FilterHigh,
Current, Remove, &Freed,
DesktopWindow, &ScreenPoint, FALSE,
&CurrentEntry);
if (Accept)
@@ -663,7 +663,7 @@
{
const ULONG ActiveStamp = HardwareMessageQueueStamp;
/* Translate the message. */
- Accept = co_MsqTranslateMouseMessage(MessageQueue, hWnd, FilterLow, FilterHigh,
+ Accept = co_MsqTranslateMouseMessage(MessageQueue, Window, FilterLow,
FilterHigh,
Current, Remove, &Freed,
DesktopWindow, &ScreenPoint, TRUE,
NULL);
if (Accept)
@@ -1326,7 +1326,7 @@
co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
- IN HWND Wnd,
+ IN PWINDOW_OBJECT Window,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message)
@@ -1337,7 +1337,7 @@
if (Hardware)
{
- return(co_MsqPeekHardwareMessage(MessageQueue, Wnd,
+ return(co_MsqPeekHardwareMessage(MessageQueue, Window,
MsgFilterLow, MsgFilterHigh,
Remove, Message));
}
@@ -1348,7 +1348,7 @@
{
CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
ListEntry);
- if ((Wnd == 0 || Wnd == CurrentMessage->Msg.hwnd) &&
+ if ((!Window || (int)Window == 1 || Window->hSelf ==
CurrentMessage->Msg.hwnd) &&
((MsgFilterLow == 0 && MsgFilterHigh == 0) ||
(MsgFilterLow <= CurrentMessage->Msg.message &&
MsgFilterHigh >= CurrentMessage->Msg.message)))
@@ -1368,7 +1368,7 @@
}
NTSTATUS FASTCALL
-co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, HWND WndFilter,
+co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
UINT MsgFilterMin, UINT MsgFilterMax)
{
PVOID WaitObjects[2] = {MessageQueue->NewMessages, &HardwareMessageEvent};
@@ -1833,7 +1833,7 @@
BOOLEAN FASTCALL
MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
- HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ PWINDOW_OBJECT WindowFilter, UINT MsgFilterMin, UINT MsgFilterMax,
MSG *Msg, BOOLEAN Restart)
{
PTIMER_ENTRY Timer;
@@ -1857,7 +1857,7 @@
DPRINT("Checking timer %p wnd %x expiry %I64d\n", Timer, Timer->Wnd,
Timer->ExpiryTime.QuadPart);
EnumEntry = EnumEntry->Flink;
- if ((NULL == WndFilter || Timer->Wnd == WndFilter) &&
+ if ((NULL == WindowFilter || Timer->Wnd == WindowFilter->hSelf) &&
((MsgFilterMin == 0 && MsgFilterMax == 0) ||
(MsgFilterMin <= Timer->Msg &&
Timer->Msg <= MsgFilterMax)))
@@ -1877,7 +1877,7 @@
else
{
DPRINT("timer %p (wnd %x msg %d) failed filter wnd %x msgmin %d msgmax
%d\n",
- Timer, Timer->Wnd, Timer->Msg, WndFilter, MsgFilterMin,
MsgFilterMax);
+ Timer, Timer->Wnd, Timer->Msg, WindowFilter->hSelf,
MsgFilterMin, MsgFilterMax);
}
}
@@ -1947,7 +1947,7 @@
BOOLEAN FASTCALL
MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
- HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+ PWINDOW_OBJECT WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
PLARGE_INTEGER FirstTimerExpiry)
{
PTIMER_ENTRY Timer;
@@ -1962,7 +1962,7 @@
Timer = CONTAINING_RECORD(MessageQueue->TimerListHead.Flink,
TIMER_ENTRY, ListEntry);
EnumEntry = EnumEntry->Flink;
- if ((NULL == WndFilter || Timer->Wnd == WndFilter) &&
+ if ((NULL == WndFilter || (int)WndFilter == 1 || Timer->Wnd ==
WndFilter->hSelf) &&
((MsgFilterMin == 0 && MsgFilterMax == 0) ||
(MsgFilterMin <= Timer->Msg &&
Timer->Msg <= MsgFilterMax)))
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] Fri Jul 3
13:37:44 2009
@@ -679,7 +679,7 @@
}
BOOL FASTCALL
-IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax,
+IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax,
PTHREADINFO Thread, MSG *Message, BOOL Remove)
{
PUSER_MESSAGE_QUEUE MessageQueue = (PUSER_MESSAGE_QUEUE)Thread->MessageQueue;
@@ -701,7 +701,7 @@
return FALSE;
}
- if (hWnd != NULL && Message->hwnd != hWnd)
+ if (Window != NULL && Message->hwnd != Window->hSelf)
return FALSE;
Message->message = WM_PAINT;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Fri Jul 3 13:37:44
2009
@@ -280,21 +280,19 @@
BOOL
FASTCALL
-PostTimerMessages(HWND hWnd)
+PostTimerMessages(PWINDOW_OBJECT Window)
{
PUSER_MESSAGE_QUEUE ThreadQueue;
MSG Msg;
PTHREADINFO pti;
- PWINDOW_OBJECT pWnd = NULL;
BOOL Hit = FALSE;
PTIMER pTmr = FirstpTmr;
if (!pTmr) return FALSE;
- if (hWnd)
- {
- pWnd = UserGetWindowObject(hWnd);
- if (!pWnd || !pWnd->Wnd) return FALSE;
+ if (Window && (int)Window != 1)
+ {
+ if (!Window->Wnd) return FALSE;
}
pti = PsGetCurrentThreadWin32Thread();
@@ -305,9 +303,9 @@
{
if ( (pTmr->flags & TMRF_READY) &&
(pTmr->pti == pti) &&
- (pTmr->pWnd == pWnd))
+ (pTmr->pWnd == Window))
{
- Msg.hwnd = hWnd;
+ Msg.hwnd = Window->hSelf;
Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
Msg.wParam = (WPARAM) pTmr->nID;
Msg.lParam = (LPARAM) pTmr->pfn;