Jacek Caban : user32: Use NtUserMessageCall for SendMessageA implementation.
Module: wine Branch: master Commit: d42888f07c6e3e491c99bb5c8b62b568264e990c URL: https://source.winehq.org/git/wine.git/?a=commit;h=d42888f07c6e3e491c99bb5c8... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Apr 4 16:58:21 2022 +0200 user32: Use NtUserMessageCall for SendMessageA implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index e42ab74cf3f..a67032ef917 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2230,20 +2230,14 @@ LRESULT WINAPI SendMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) */ LRESULT WINAPI SendMessageA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { - DWORD_PTR res = 0; - struct send_message_info info; - - info.type = MSG_ASCII; - info.hwnd = hwnd; - info.msg = msg; - info.wparam = wparam; - info.lparam = lparam; - info.flags = SMTO_NORMAL; - info.timeout = 0; - info.wm_char = WMCHAR_MAP_SENDMESSAGE; + if (msg == WM_CHAR && !WIN_IsCurrentThread( hwnd )) + { + if (!map_wparam_AtoW( msg, &wparam, WMCHAR_MAP_SENDMESSAGE )) + return 0; + return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, FNID_SENDMESSAGE, FALSE ); + } - send_message( &info, &res, FALSE ); - return res; + return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, FNID_SENDMESSAGE, TRUE ); }
participants (1)
-
Alexandre Julliard