DispatchMessageA(CONST MSG *lpmsg)
{
LRESULT Ret = 0;
+ MSG UnicodeMsg;
PWINDOW Wnd;
if (lpmsg->hwnd != NULL)
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,
}
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;
+}
/*
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,
}
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;
FASTCALL
IntDispatchMessage(PMSG pMsg)
{
+ LARGE_INTEGER TickCount;
+ LONG Time;
LRESULT retval;
PWINDOW_OBJECT Window = NULL;
{
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;
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;
}