Jacek Caban : win32u: Use syscall interface for NtUserDispatchMessage.

Alexandre Julliard julliard at winehq.org
Thu Jul 21 17:04:08 CDT 2022


Module: wine
Branch: master
Commit: 1e5d4e94229201b66f62a89138bf6c654e91f335
URL:    https://gitlab.winehq.org/wine/wine/-/commit/1e5d4e94229201b66f62a89138bf6c654e91f335

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Jul  9 17:19:02 2022 +0200

win32u: Use syscall interface for NtUserDispatchMessage.

---

 dlls/win32u/gdiobj.c         |  1 -
 dlls/win32u/message.c        | 10 +---------
 dlls/win32u/syscall.c        |  1 +
 dlls/win32u/win32u.spec      |  2 +-
 dlls/win32u/win32u_private.h |  1 -
 dlls/win32u/wrappers.c       |  6 ------
 dlls/wow64win/syscall.h      |  1 +
 dlls/wow64win/user.c         | 10 +++++++++-
 8 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index fddaf898761..e5c2c185511 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -1158,7 +1158,6 @@ static struct unix_funcs unix_funcs =
     NtUserDestroyMenu,
     NtUserDestroyWindow,
     NtUserDisableThreadIme,
-    NtUserDispatchMessage,
     NtUserDragDetect,
     NtUserDrawCaptionTemp,
     NtUserDrawIconEx,
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index 1b9585c4178..7045aedb4b1 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -2514,15 +2514,7 @@ LRESULT WINAPI NtUserDispatchMessage( const MSG *msg )
         if (!init_win_proc_params( &params, msg->hwnd, msg->message,
                                    msg->wParam, NtGetTickCount(), FALSE ))
             return 0;
-        __TRY
-        {
-            dispatch_win_proc_params( &params, sizeof(params) );
-        }
-        __EXCEPT
-        {
-            retval = 0;
-        }
-        __ENDTRY
+        dispatch_win_proc_params( &params, sizeof(params) );
         return retval;
     }
     if (msg->message == WM_SYSTIMER)
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
index f5508f62d16..a7e18158fb5 100644
--- a/dlls/win32u/syscall.c
+++ b/dlls/win32u/syscall.c
@@ -117,6 +117,7 @@ static void * const syscalls[] =
     NtUserDeleteMenu,
     NtUserDestroyAcceleratorTable,
     NtUserDestroyInputContext,
+    NtUserDispatchMessage,
     NtUserEndMenu,
     NtUserFindExistingCursorIcon,
     NtUserFindWindowEx,
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index d74685ad603..7ec96eedfcf 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -839,7 +839,7 @@
 @ stub NtUserDisableProcessWindowFiltering
 @ stdcall NtUserDisableThreadIme(long)
 @ stub NtUserDiscardPointerFrameMessages
-@ stdcall NtUserDispatchMessage(ptr)
+@ stdcall -syscall NtUserDispatchMessage(ptr)
 @ stub NtUserDisplayConfigGetDeviceInfo
 @ stub NtUserDisplayConfigSetDeviceInfo
 @ stub NtUserDoSoundConnect
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index 914a02ffd52..d5b3e0fdda8 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -215,7 +215,6 @@ struct unix_funcs
     BOOL     (WINAPI *pNtUserDestroyMenu)( HMENU handle );
     BOOL     (WINAPI *pNtUserDestroyWindow)( HWND hwnd );
     BOOL     (WINAPI *pNtUserDisableThreadIme)( DWORD thread_id );
-    LRESULT  (WINAPI *pNtUserDispatchMessage)( const MSG *msg );
     BOOL     (WINAPI *pNtUserDragDetect)( HWND hwnd, int x, int y );
     BOOL     (WINAPI *pNtUserDrawCaptionTemp)( HWND hwnd, HDC hdc, const RECT *rect, HFONT font,
                                                HICON icon, const WCHAR *str, UINT flags );
diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c
index 609e893403b..9c2264e887e 100644
--- a/dlls/win32u/wrappers.c
+++ b/dlls/win32u/wrappers.c
@@ -855,12 +855,6 @@ BOOL WINAPI NtUserDisableThreadIme( DWORD thread_id )
     return unix_funcs->pNtUserDisableThreadIme( thread_id );
 }
 
-LRESULT WINAPI NtUserDispatchMessage( const MSG *msg )
-{
-    if (!unix_funcs) return 0;
-    return unix_funcs->pNtUserDispatchMessage( msg );
-}
-
 BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y )
 {
     if (!unix_funcs) return FALSE;
diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h
index 005037d71a5..3842eb3c1da 100644
--- a/dlls/wow64win/syscall.h
+++ b/dlls/wow64win/syscall.h
@@ -104,6 +104,7 @@
     SYSCALL_ENTRY( NtUserDeleteMenu ) \
     SYSCALL_ENTRY( NtUserDestroyAcceleratorTable ) \
     SYSCALL_ENTRY( NtUserDestroyInputContext ) \
+    SYSCALL_ENTRY( NtUserDispatchMessage ) \
     SYSCALL_ENTRY( NtUserEndMenu ) \
     SYSCALL_ENTRY( NtUserFindExistingCursorIcon ) \
     SYSCALL_ENTRY( NtUserFindWindowEx ) \
diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c
index 386458ccf0c..7ca1e87109d 100644
--- a/dlls/wow64win/user.c
+++ b/dlls/wow64win/user.c
@@ -78,7 +78,7 @@ typedef struct
     DWORD dwType;
 } RAWINPUTDEVICELIST32;
 
-static MSG *msg_32to64( MSG *msg, MSG32 *msg32 )
+static MSG *msg_32to64( MSG *msg, const MSG32 *msg32 )
 {
     if (!msg32) return NULL;
 
@@ -281,6 +281,14 @@ NTSTATUS WINAPI wow64_NtUserDestroyInputContext( UINT *args )
     return NtUserDestroyInputContext( handle );
 }
 
+NTSTATUS WINAPI wow64_NtUserDispatchMessage( UINT *args )
+{
+    const MSG32 *msg32 = get_ptr( &args );
+    MSG msg;
+
+    return NtUserDispatchMessage( msg_32to64( &msg, msg32 ));
+}
+
 NTSTATUS WINAPI wow64_NtUserEndMenu( UINT *args )
 {
     return NtUserEndMenu();




More information about the wine-cvs mailing list