Author: jimtabor
Date: Fri Jan 16 19:03:03 2009
New Revision: 38803
URL:
http://svn.reactos.org/svn/reactos?rev=38803&view=rev
Log:
- Update DispathMessage and fix time stamp for system and standard timers. Tested with
qemu bootcd, cmd and explorer. If any bugs arise please log them under Timer Rewrite then
associate the older or newer related bugs under it.
Modified:
trunk/reactos/dll/win32/user32/windows/message.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Fri Jan 16 19:03:03
2009
@@ -1335,6 +1335,7 @@
DispatchMessageA(CONST MSG *lpmsg)
{
LRESULT Ret = 0;
+ MSG UnicodeMsg;
PWINDOW Wnd;
if (lpmsg->hwnd != NULL)
@@ -1349,6 +1350,10 @@
if ((lpmsg->message == WM_TIMER || lpmsg->message == WM_SYSTIMER) &&
lpmsg->lParam != 0)
{
WNDPROC WndProc = (WNDPROC)lpmsg->lParam;
+
+ if ( lpmsg->message == WM_SYSTIMER )
+ return NtUserDispatchMessage( (PMSG)lpmsg );
+
Ret = WndProc(lpmsg->hwnd,
lpmsg->message,
lpmsg->wParam,
@@ -1356,16 +1361,33 @@
}
else if (Wnd != NULL)
{
- /* FIXME: WM_PAINT needs special handling */
- Ret = IntCallMessageProc(Wnd,
- lpmsg->hwnd,
- lpmsg->message,
- lpmsg->wParam,
- lpmsg->lParam,
- TRUE);
- }
-
- return Ret;}
+ // FIXME Need to test for calling proc inside win32k!
+ if ( (lpmsg->message != WM_PAINT) ) // && !(Wnd->flags &
WNDF_CALLPROC) )
+ {
+ Ret = IntCallMessageProc(Wnd,
+ lpmsg->hwnd,
+ lpmsg->message,
+ lpmsg->wParam,
+ lpmsg->lParam,
+ TRUE);
+ }
+ else
+ {
+ if (!MsgiAnsiToUnicodeMessage(&UnicodeMsg, (LPMSG)lpmsg))
+ {
+ return FALSE;
+ }
+
+ Ret = NtUserDispatchMessage(&UnicodeMsg);
+
+ if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, (LPMSG)lpmsg, &Ret))
+ {
+ return FALSE;
+ }
+ }
+ }
+ return Ret;
+}
/*
@@ -1389,6 +1411,10 @@
if ((lpmsg->message == WM_TIMER || lpmsg->message == WM_SYSTIMER) &&
lpmsg->lParam != 0)
{
WNDPROC WndProc = (WNDPROC)lpmsg->lParam;
+
+ if ( lpmsg->message == WM_SYSTIMER )
+ return NtUserDispatchMessage( (PMSG) lpmsg );
+
Ret = WndProc(lpmsg->hwnd,
lpmsg->message,
lpmsg->wParam,
@@ -1396,13 +1422,18 @@
}
else if (Wnd != NULL)
{
- /* FIXME: WM_PAINT needs special handling */
- Ret = IntCallMessageProc(Wnd,
- lpmsg->hwnd,
- lpmsg->message,
- lpmsg->wParam,
- lpmsg->lParam,
- FALSE);
+ // FIXME Need to test for calling proc inside win32k!
+ if ( (lpmsg->message != WM_PAINT) ) // && !(Wnd->flags &
W32K_CALLPROC) )
+ {
+ Ret = IntCallMessageProc(Wnd,
+ lpmsg->hwnd,
+ lpmsg->message,
+ lpmsg->wParam,
+ lpmsg->lParam,
+ FALSE);
+ }
+ else
+ Ret = NtUserDispatchMessage( (PMSG) lpmsg );
}
return Ret;
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Fri Jan 16 19:03:03 2009
@@ -135,6 +135,10 @@
UINT MenuNameIsString : 1;
UINT NotUsed : 27;
} WINDOWCLASS, *PWINDOWCLASS;
+
+
+// Flags !Not Implemented!
+#define WNDF_CALLPROC 0x0004 // Call proc inside win32k.
typedef struct _WINDOW
{
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 Jan 16
19:03:03 2009
@@ -345,6 +345,8 @@
FASTCALL
IntDispatchMessage(PMSG pMsg)
{
+ LARGE_INTEGER TickCount;
+ LONG Time;
LRESULT retval;
PWINDOW_OBJECT Window = NULL;
@@ -362,12 +364,14 @@
{
if
(ValidateTimerCallback(PsGetCurrentThreadWin32Thread(),Window,pMsg->wParam,pMsg->lParam))
{
+ KeQueryTickCount(&TickCount);
+ Time = MsqCalculateMessageTime(&TickCount);
return co_IntCallWindowProc((WNDPROC)pMsg->lParam,
TRUE,
pMsg->hwnd,
WM_TIMER,
pMsg->wParam,
- (LPARAM)EngGetTickCount(),
+ (LPARAM)Time,
sizeof(LPARAM));
}
return 0;
@@ -377,7 +381,9 @@
PTIMER pTimer = FindSystemTimer(pMsg);
if (pTimer && pTimer->pfn)
{
- pTimer->pfn(pMsg->hwnd, WM_SYSTIMER, (UINT)pMsg->wParam,
(DWORD)EngGetTickCount());
+ KeQueryTickCount(&TickCount);
+ Time = MsqCalculateMessageTime(&TickCount);
+ pTimer->pfn(pMsg->hwnd, WM_SYSTIMER, (UINT)pMsg->wParam, Time);
}
return 0;
}