From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/message.c | 5 +---- dlls/win32u/message.c | 12 ++++++++++-- include/ntuser.h | 1 + 3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index e62e0566dd9..097e8fd4391 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -713,10 +713,7 @@ BOOL WINAPI InSendMessage(void) */ DWORD WINAPI InSendMessageEx( LPVOID reserved ) { - struct received_message_info *info = get_user_thread_info()->receive_info; - - if (info) return info->flags; - return ISMEX_NOSEND; + return NtUserGetThreadInfo()->receive_flags; }
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index e262fd7ab22..5fb065e1208 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -1045,6 +1045,8 @@ static void reply_message( struct received_message_info *info, LRESULT result, M
memset( &data, 0, sizeof(data) ); info->flags |= ISMEX_REPLIED; + if (info == get_user_thread_info()->receive_info) + NtUserGetThreadInfo()->receive_flags = info->flags;
if (info->type == MSG_OTHER_PROCESS && !replied) { @@ -1069,11 +1071,16 @@ static void reply_message( struct received_message_info *info, LRESULT result, M */ BOOL reply_message_result( LRESULT result, MSG *msg ) { - struct received_message_info *info = get_user_thread_info()->receive_info; + struct user_thread_info *thread_info = get_user_thread_info(); + struct received_message_info *info = thread_info->receive_info;
if (!info) return FALSE; reply_message( info, result, msg ); - if (msg) get_user_thread_info()->receive_info = info->prev; + if (msg) + { + thread_info->receive_info = info->prev; + thread_info->client_info.receive_flags = info->prev ? info->prev->flags : ISMEX_NOSEND; + } return TRUE; }
@@ -1865,6 +1872,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, info.prev = thread_info->receive_info; thread_info->receive_info = &info; thread_info->client_info.msg_source = msg_source_unavailable; + thread_info->client_info.receive_flags = info.flags; result = call_window_proc( info.msg.hwnd, info.msg.message, info.msg.wParam, info.msg.lParam, (info.type != MSG_ASCII), FALSE, WMCHAR_MAP_RECVMESSAGE, needs_unpack, buffer, size ); diff --git a/include/ntuser.h b/include/ntuser.h index 5bc92fb562c..07b5afe7919 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -67,6 +67,7 @@ struct ntuser_thread_info ULONG_PTR message_extra; /* value for GetMessageExtraInfo */ INPUT_MESSAGE_SOURCE msg_source; /* Message source for current message */ WORD recursion_count; /* SendMessage recursion counter */ + UINT receive_flags; /* currently received message flags */ HWND top_window; /* desktop window */ HWND msg_window; /* HWND_MESSAGE parent window */ DPI_AWARENESS dpi_awareness; /* DPI awareness */