mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
- 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:
parent
6df90967f0
commit
1a0ed06ffc
3 changed files with 59 additions and 18 deletions
|
@ -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,16 +1361,33 @@ DispatchMessageA(CONST MSG *lpmsg)
|
|||
}
|
||||
else if (Wnd != NULL)
|
||||
{
|
||||
/* FIXME: WM_PAINT needs special handling */
|
||||
Ret = IntCallMessageProc(Wnd,
|
||||
lpmsg->hwnd,
|
||||
lpmsg->message,
|
||||
lpmsg->wParam,
|
||||
lpmsg->lParam,
|
||||
TRUE);
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
||||
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,13 +1422,18 @@ DispatchMessageW(CONST MSG *lpmsg)
|
|||
}
|
||||
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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue