- 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.

svn path=/trunk/; revision=38803
This commit is contained in:
James Tabor 2009-01-17 01:03:03 +00:00
parent 6df90967f0
commit 1a0ed06ffc
3 changed files with 59 additions and 18 deletions

View file

@ -1335,6 +1335,7 @@ LRESULT WINAPI
DispatchMessageA(CONST MSG *lpmsg)
{
LRESULT Ret = 0;
MSG UnicodeMsg;
PWINDOW Wnd;
if (lpmsg->hwnd != NULL)
@ -1349,6 +1350,10 @@ DispatchMessageA(CONST MSG *lpmsg)
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,7 +1361,9 @@ DispatchMessageA(CONST MSG *lpmsg)
}
else if (Wnd != NULL)
{
/* FIXME: WM_PAINT needs special handling */
// 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,
@ -1364,8 +1371,23 @@ DispatchMessageA(CONST MSG *lpmsg)
lpmsg->lParam,
TRUE);
}
else
{
if (!MsgiAnsiToUnicodeMessage(&UnicodeMsg, (LPMSG)lpmsg))
{
return FALSE;
}
return Ret;}
Ret = NtUserDispatchMessage(&UnicodeMsg);
if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, (LPMSG)lpmsg, &Ret))
{
return FALSE;
}
}
}
return Ret;
}
/*
@ -1389,6 +1411,10 @@ DispatchMessageW(CONST MSG *lpmsg)
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,7 +1422,9 @@ DispatchMessageW(CONST MSG *lpmsg)
}
else if (Wnd != NULL)
{
/* FIXME: WM_PAINT needs special handling */
// 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,
@ -1404,6 +1432,9 @@ DispatchMessageW(CONST MSG *lpmsg)
lpmsg->lParam,
FALSE);
}
else
Ret = NtUserDispatchMessage( (PMSG) lpmsg );
}
return Ret;
}

View file

@ -136,6 +136,10 @@ typedef struct _WINDOWCLASS
UINT NotUsed : 27;
} WINDOWCLASS, *PWINDOWCLASS;
// Flags !Not Implemented!
#define WNDF_CALLPROC 0x0004 // Call proc inside win32k.
typedef struct _WINDOW
{
USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is implemented */

View file

@ -345,6 +345,8 @@ LRESULT
FASTCALL
IntDispatchMessage(PMSG pMsg)
{
LARGE_INTEGER TickCount;
LONG Time;
LRESULT retval;
PWINDOW_OBJECT Window = NULL;
@ -362,12 +364,14 @@ IntDispatchMessage(PMSG pMsg)
{
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 @@ IntDispatchMessage(PMSG pMsg)
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;
}