mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
UserPostMessage: when dealing with WM_QUIT, allow broadcasting like windows does and post it to the window's message queue instead of the current thread's message queue. Fixes a hang in user32_winetest msg. Patch by Giannis Adamopoulos.
See issue #4058 for more details. svn path=/trunk/; revision=40964
This commit is contained in:
parent
6bdda5357f
commit
05a7fd23a3
1 changed files with 24 additions and 21 deletions
|
@ -1309,11 +1309,7 @@ UserPostMessage(HWND Wnd,
|
||||||
PMSGMEMORY MsgMemoryEntry;
|
PMSGMEMORY MsgMemoryEntry;
|
||||||
|
|
||||||
pti = PsGetCurrentThreadWin32Thread();
|
pti = PsGetCurrentThreadWin32Thread();
|
||||||
if (WM_QUIT == Msg)
|
if (Wnd == HWND_BROADCAST)
|
||||||
{
|
|
||||||
MsqPostQuitMessage(pti->MessageQueue, wParam);
|
|
||||||
}
|
|
||||||
else if (Wnd == HWND_BROADCAST)
|
|
||||||
{
|
{
|
||||||
HWND *List;
|
HWND *List;
|
||||||
PWINDOW_OBJECT DesktopWindow;
|
PWINDOW_OBJECT DesktopWindow;
|
||||||
|
@ -1345,24 +1341,31 @@ UserPostMessage(HWND Wnd,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserModeMsg.hwnd = Wnd;
|
if (WM_QUIT == Msg)
|
||||||
UserModeMsg.message = Msg;
|
|
||||||
UserModeMsg.wParam = wParam;
|
|
||||||
UserModeMsg.lParam = lParam;
|
|
||||||
MsgMemoryEntry = FindMsgMemory(UserModeMsg.message);
|
|
||||||
Status = CopyMsgToKernelMem(&KernelModeMsg, &UserModeMsg, MsgMemoryEntry);
|
|
||||||
if (! NT_SUCCESS(Status))
|
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
MsqPostQuitMessage(Window->MessageQueue, wParam);
|
||||||
return FALSE;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UserModeMsg.hwnd = Wnd;
|
||||||
|
UserModeMsg.message = Msg;
|
||||||
|
UserModeMsg.wParam = wParam;
|
||||||
|
UserModeMsg.lParam = lParam;
|
||||||
|
MsgMemoryEntry = FindMsgMemory(UserModeMsg.message);
|
||||||
|
Status = CopyMsgToKernelMem(&KernelModeMsg, &UserModeMsg, MsgMemoryEntry);
|
||||||
|
if (! NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
IntGetCursorLocation(pti->Desktop->WindowStation,
|
||||||
|
&KernelModeMsg.pt);
|
||||||
|
KeQueryTickCount(&LargeTickCount);
|
||||||
|
pti->timeLast = KernelModeMsg.time = MsqCalculateMessageTime(&LargeTickCount);
|
||||||
|
MsqPostMessage(Window->MessageQueue, &KernelModeMsg,
|
||||||
|
NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam,
|
||||||
|
QS_POSTMESSAGE);
|
||||||
}
|
}
|
||||||
IntGetCursorLocation(pti->Desktop->WindowStation,
|
|
||||||
&KernelModeMsg.pt);
|
|
||||||
KeQueryTickCount(&LargeTickCount);
|
|
||||||
pti->timeLast = KernelModeMsg.time = MsqCalculateMessageTime(&LargeTickCount);
|
|
||||||
MsqPostMessage(Window->MessageQueue, &KernelModeMsg,
|
|
||||||
NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam,
|
|
||||||
QS_POSTMESSAGE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue