From 641cc6402f35396c560458427527f0df09b7b6f1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 29 Oct 2008 12:12:21 +0100 Subject: [PATCH] user32: Move thread info setting and WH_GETMESSAGE call into peek_message. --- dlls/user32/message.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 597ad711826..82350a3fdfb 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2174,7 +2174,6 @@ static BOOL peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags info.msg.message, flags | PM_REMOVE ); goto next; } - thread_info->GetMessageExtraInfoVal = extra_info; if (info.msg.message >= WM_DDE_FIRST && info.msg.message <= WM_DDE_LAST) { if (!unpack_dde_message( info.msg.hwnd, info.msg.message, &info.msg.wParam, @@ -2182,7 +2181,12 @@ static BOOL peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags goto next; /* ignore it */ } *msg = info.msg; + msg->pt.x = (short)LOWORD( thread_info->GetMessagePosVal ); + msg->pt.y = (short)HIWORD( thread_info->GetMessagePosVal ); + thread_info->GetMessageTimeVal = info.msg.time; + thread_info->GetMessageExtraInfoVal = extra_info; HeapFree( GetProcessHeap(), 0, buffer ); + HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg, TRUE ); return TRUE; } @@ -2870,7 +2874,6 @@ void WINAPI PostQuitMessage( INT exit_code ) */ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT flags ) { - struct user_thread_info *thread_info = get_user_thread_info(); MSG msg; USER_CheckNotLock(); @@ -2890,12 +2893,6 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f return FALSE; } - thread_info->GetMessageTimeVal = msg.time; - msg.pt.x = (short)LOWORD( thread_info->GetMessagePosVal ); - msg.pt.y = (short)HIWORD( thread_info->GetMessagePosVal ); - - HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)&msg, TRUE ); - /* copy back our internal safe copy of message data to msg_out. * msg_out is a variable from the *program*, so it can't be used * internally as it can get "corrupted" by our use of SendMessage() -- 2.11.4.GIT