Jacek Caban : win32u: Move SendMessageW implementation from user32.

Alexandre Julliard julliard at winehq.org
Tue Apr 5 15:39:44 CDT 2022


Module: wine
Branch: master
Commit: 30cc496099705faaf282d5dbe66b27a75ba17b20
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=30cc496099705faaf282d5dbe66b27a75ba17b20

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Apr  4 16:57:52 2022 +0200

win32u: Move SendMessageW implementation from user32.

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        | 14 +-------------
 dlls/user32/user_main.c      |  2 --
 dlls/win32u/message.c        | 19 ++++++++++++++-----
 dlls/win32u/ntuser_private.h |  2 --
 4 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 138c8d73941..d54d5b55e50 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2217,19 +2217,7 @@ LRESULT WINAPI SendMessageTimeoutA( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
  */
 LRESULT WINAPI SendMessageW( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
 {
-    DWORD_PTR res = 0;
-    struct send_message_info info;
-
-    info.type    = MSG_UNICODE;
-    info.hwnd    = hwnd;
-    info.msg     = msg;
-    info.wparam  = wparam;
-    info.lparam  = lparam;
-    info.flags   = SMTO_NORMAL;
-    info.timeout = 0;
-
-    send_message( &info, &res, TRUE );
-    return res;
+    return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, FNID_SENDMESSAGE, FALSE );
 }
 
 
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 789533329c3..3fd05ec3f01 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -165,8 +165,6 @@ static const struct user_callbacks user_funcs =
     EndMenu,
     HideCaret,
     PostMessageW,
-    SendMessageA,
-    SendMessageW,
     SendNotifyMessageW,
     SetSystemMenu,
     ShowCaret,
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index 359a3cadbab..41d97e648a0 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -2234,11 +2234,20 @@ BOOL kill_system_timer( HWND hwnd, UINT_PTR id )
 
 static LRESULT send_window_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi )
 {
-    /* FIXME: move implementation from user32 */
-    if (!user_callbacks) return FALSE;
-    return ansi
-        ? user_callbacks->pSendMessageA( hwnd, msg, wparam, lparam )
-        : user_callbacks->pSendMessageW( hwnd, msg, wparam, lparam );
+    struct send_message_info info;
+    DWORD_PTR res = 0;
+
+    info.type    = ansi ? MSG_ASCII : MSG_UNICODE;
+    info.hwnd    = hwnd;
+    info.msg     = msg;
+    info.wparam  = wparam;
+    info.lparam  = lparam;
+    info.flags   = SMTO_NORMAL;
+    info.timeout = 0;
+    info.wm_char = WMCHAR_MAP_SENDMESSAGETIMEOUT;
+
+    process_message( &info, &res, ansi );
+    return res;
 }
 
 /* see SendMessageTimeoutW */
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index d69e24a1dab..f9623446f6d 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -38,8 +38,6 @@ struct user_callbacks
     BOOL (WINAPI *pEndMenu)(void);
     BOOL (WINAPI *pHideCaret)( HWND hwnd );
     BOOL (WINAPI *pPostMessageW)( HWND, UINT, WPARAM, LPARAM );
-    LRESULT (WINAPI *pSendMessageA)( HWND, UINT, WPARAM, LPARAM );
-    LRESULT (WINAPI *pSendMessageW)( HWND, UINT, WPARAM, LPARAM );
     BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM );
     BOOL (WINAPI *pSetSystemMenu)( HWND hwnd, HMENU menu );
     BOOL (WINAPI *pShowCaret)( HWND hwnd );




More information about the wine-cvs mailing list