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:
Timo Kreuzer 2009-05-17 22:22:20 +00:00
parent 6bdda5357f
commit 05a7fd23a3

View file

@ -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,6 +1341,12 @@ UserPostMessage(HWND Wnd,
return FALSE; return FALSE;
} }
if (WM_QUIT == Msg)
{
MsqPostQuitMessage(Window->MessageQueue, wParam);
}
else
{
UserModeMsg.hwnd = Wnd; UserModeMsg.hwnd = Wnd;
UserModeMsg.message = Msg; UserModeMsg.message = Msg;
UserModeMsg.wParam = wParam; UserModeMsg.wParam = wParam;
@ -1364,6 +1366,7 @@ UserPostMessage(HWND Wnd,
NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam, NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam,
QS_POSTMESSAGE); QS_POSTMESSAGE);
} }
}
return TRUE; return TRUE;
} }