Jacek Caban : user32: Use NtUserMessageCall for SendMessageTimeoutA implementation.
Alexandre Julliard
julliard at winehq.org
Tue Apr 5 15:39:44 CDT 2022
Module: wine
Branch: master
Commit: 52eac01237c5e77d7c720731bc1844b196034edd
URL: https://source.winehq.org/git/wine.git/?a=commit;h=52eac01237c5e77d7c720731bc1844b196034edd
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Apr 4 16:58:00 2022 +0200
user32: Use NtUserMessageCall for SendMessageTimeoutA implementation.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/message.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index d54d5b55e50..e42ab74cf3f 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2197,18 +2197,22 @@ LRESULT WINAPI SendMessageTimeoutW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
LRESULT WINAPI SendMessageTimeoutA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
UINT flags, UINT timeout, PDWORD_PTR res_ptr )
{
- struct send_message_info info;
+ struct send_message_timeout_params params = { .flags = flags, .timeout = timeout };
+ LRESULT res = 0;
- info.type = MSG_ASCII;
- info.hwnd = hwnd;
- info.msg = msg;
- info.wparam = wparam;
- info.lparam = lparam;
- info.flags = flags;
- info.timeout = timeout;
- info.wm_char = WMCHAR_MAP_SENDMESSAGETIMEOUT;
+ if (msg != WM_CHAR || WIN_IsCurrentThread( hwnd ))
+ {
+ res = NtUserMessageCall( hwnd, msg, wparam, lparam, ¶ms,
+ FNID_SENDMESSAGEWTOOPTION, TRUE );
+ }
+ else if (map_wparam_AtoW( msg, &wparam, WMCHAR_MAP_SENDMESSAGE ))
+ {
+ res = NtUserMessageCall( hwnd, msg, wparam, lparam, ¶ms,
+ FNID_SENDMESSAGEWTOOPTION, FALSE );
+ }
- return send_message( &info, res_ptr, FALSE );
+ if (res_ptr) *res_ptr = res;
+ return params.result;
}
More information about the wine-cvs
mailing list