From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/user_main.c | 1 - dlls/win32u/driver.c | 8 ++------ dlls/win32u/gdiobj.c | 1 - dlls/win32u/ntuser_private.h | 1 - dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 2 -- dlls/win32u/wrappers.c | 7 ------- dlls/wineandroid.drv/android.h | 2 -- dlls/wineandroid.drv/dllmain.c | 1 - dlls/wineandroid.drv/init.c | 3 --- dlls/wineandroid.drv/unixlib.h | 1 - dlls/wineandroid.drv/window.c | 4 ++-- dlls/winemac.drv/dllmain.c | 1 - dlls/winemac.drv/event.c | 8 ++++---- dlls/winemac.drv/macdrv.h | 3 --- dlls/winemac.drv/macdrv_main.c | 3 --- dlls/winemac.drv/unixlib.h | 1 - dlls/winex11.drv/dllmain.c | 1 - dlls/winex11.drv/event.c | 8 ++++---- dlls/winex11.drv/unixlib.h | 1 - dlls/winex11.drv/x11drv.h | 3 --- dlls/winex11.drv/x11drv_main.c | 9 --------- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 21 +++++++++++++++++++++ 25 files changed, 36 insertions(+), 58 deletions(-)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 16ce5c6a854..7125e32b154 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -133,7 +133,6 @@ static NTSTATUS try_finally( NTSTATUS (CDECL *func)( void *), void *arg,
static const struct user_callbacks user_funcs = { - NtWaitForMultipleObjects, try_finally, };
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index baa0143be61..3d29453c2bf 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -811,12 +811,8 @@ static NTSTATUS nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE * DWORD mask, DWORD flags ) { if (!count && timeout && !timeout->QuadPart) return WAIT_TIMEOUT; - - if (!user_callbacks) - return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); - return user_callbacks->pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); }
static void nulldrv_ReleaseDC( HWND hwnd, HDC hdc ) diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index e5c2c185511..2c3d46b7a5b 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1200,7 +1200,6 @@ static struct unix_funcs unix_funcs = NtUserMapVirtualKeyEx, NtUserMessageCall, NtUserMoveWindow, - NtUserMsgWaitForMultipleObjectsEx, NtUserOpenClipboard, NtUserPeekMessage, NtUserPostMessage, diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 9c23799c6bb..69adad822a0 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -32,7 +32,6 @@ struct hardware_msg_data;
struct user_callbacks { - NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); NTSTATUS (CDECL *try_finally)( NTSTATUS (CDECL *func)( void *), void *arg, void (CALLBACK *finally_func)( BOOL )); }; diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index a7e18158fb5..f4ec0b8dc3b 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -163,6 +163,7 @@ static void * const syscalls[] = NtUserKillTimer, NtUserLockWindowUpdate, NtUserMenuItemFromPoint, + NtUserMsgWaitForMultipleObjectsEx, NtUserNotifyWinEvent, NtUserOpenDesktop, NtUserOpenInputDesktop, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 7ec96eedfcf..b56059e7fd8 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1085,7 +1085,7 @@ @ stub NtUserModifyUserStartupInfoFlags @ stub NtUserModifyWindowTouchCapability @ stdcall NtUserMoveWindow(long long long long long long) -@ stdcall NtUserMsgWaitForMultipleObjectsEx(long ptr long long long) +@ stdcall -syscall NtUserMsgWaitForMultipleObjectsEx(long ptr long long long) @ stub NtUserNavigateFocus @ stub NtUserNotifyIMEStatus @ stub NtUserNotifyProcessCreate diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index d5b3e0fdda8..d811ac6e879 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -265,8 +265,6 @@ struct unix_funcs LRESULT (WINAPI *pNtUserMessageCall)( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, void *result_info, DWORD type, BOOL ansi ); BOOL (WINAPI *pNtUserMoveWindow)( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint ); - DWORD (WINAPI *pNtUserMsgWaitForMultipleObjectsEx)( DWORD count, const HANDLE *handles, - DWORD timeout, DWORD mask, DWORD flags ); BOOL (WINAPI *pNtUserOpenClipboard)( HWND hwnd, ULONG unk ); BOOL (WINAPI *pNtUserPeekMessage)( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT flags ); BOOL (WINAPI *pNtUserPostMessage)( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ); diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index 9c2264e887e..4c22c14ca6f 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -1110,13 +1110,6 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa return unix_funcs->pNtUserMessageCall( hwnd, msg, wparam, lparam, result_info, type, ansi ); }
-DWORD WINAPI NtUserMsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, - DWORD timeout, DWORD mask, DWORD flags ) -{ - if (!unix_funcs) return 0; - return unix_funcs->pNtUserMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags ); -} - BOOL WINAPI NtUserOpenClipboard( HWND hwnd, ULONG unk ) { if (!unix_funcs) return FALSE; diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h index 57f566b3cfd..22652f11d27 100644 --- a/dlls/wineandroid.drv/android.h +++ b/dlls/wineandroid.drv/android.h @@ -120,8 +120,6 @@ extern NTSTATUS android_java_init( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS android_java_uninit( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS android_register_window( void *arg ) DECLSPEC_HIDDEN; extern PNTAPCFUNC register_window_callback; -extern NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG,const HANDLE*,BOOLEAN, - BOOLEAN,const LARGE_INTEGER* ) DECLSPEC_HIDDEN;
extern unsigned int screen_width DECLSPEC_HIDDEN; extern unsigned int screen_height DECLSPEC_HIDDEN; diff --git a/dlls/wineandroid.drv/dllmain.c b/dlls/wineandroid.drv/dllmain.c index 81581591770..6556a492505 100644 --- a/dlls/wineandroid.drv/dllmain.c +++ b/dlls/wineandroid.drv/dllmain.c @@ -130,7 +130,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) return FALSE;
params.register_window_callback = register_window_callback; - params.pNtWaitForMultipleObjects = NtWaitForMultipleObjects; if (__wine_unix_call( unix_handle, unix_init, ¶ms )) return FALSE;
callback_table = NtCurrentTeb()->Peb->KernelCallbackTable; diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index a82932bf65f..83fe224dccf 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -563,8 +563,6 @@ jobject *p_java_object = NULL; unsigned short *p_java_gdt_sel = NULL;
static NTSTATUS CDECL unix_call( enum android_funcs code, void *params ); -NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG,const HANDLE*,BOOLEAN, - BOOLEAN,const LARGE_INTEGER* );
static HRESULT android_init( void *arg ) { @@ -611,7 +609,6 @@ static HRESULT android_init( void *arg ) #endif } __wine_set_user_driver( &android_drv_funcs, WINE_GDI_DRIVER_VERSION ); - pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects; params->unix_call = unix_call; return STATUS_SUCCESS; } diff --git a/dlls/wineandroid.drv/unixlib.h b/dlls/wineandroid.drv/unixlib.h index 92d28176ee7..2b4d02648e5 100644 --- a/dlls/wineandroid.drv/unixlib.h +++ b/dlls/wineandroid.drv/unixlib.h @@ -37,7 +37,6 @@ enum android_funcs struct init_params { PNTAPCFUNC register_window_callback; - NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER* ); NTSTATUS (CDECL *unix_call)( enum android_funcs code, void *params ); };
diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index c580a36c828..9406236a405 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1212,8 +1212,8 @@ NTSTATUS ANDROID_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles if (current_event) mask = 0; if (process_events( mask )) return count - 1; } - return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); }
/********************************************************************** diff --git a/dlls/winemac.drv/dllmain.c b/dlls/winemac.drv/dllmain.c index 0618ec83228..567485b2f03 100644 --- a/dlls/winemac.drv/dllmain.c +++ b/dlls/winemac.drv/dllmain.c @@ -414,7 +414,6 @@ static BOOL process_attach(void) str->len = LoadStringW(macdrv_module, str->id, (WCHAR *)&str->str, 0); params.strings = strings;
- params.pNtWaitForMultipleObjects = NtWaitForMultipleObjects; if (__wine_unix_call(macdrv_handle, unix_init, ¶ms)) return FALSE;
callback_table = NtCurrentTeb()->Peb->KernelCallbackTable; diff --git a/dlls/winemac.drv/event.c b/dlls/winemac.drv/event.c index d76c6ee8edb..ef1ab23bb1d 100644 --- a/dlls/winemac.drv/event.c +++ b/dlls/winemac.drv/event.c @@ -525,8 +525,8 @@ NTSTATUS macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handles, if (!data) { if (!count && timeout && !timeout->QuadPart) return WAIT_TIMEOUT; - return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); }
if (data->current_event && data->current_event->type != QUERY_EVENT && @@ -538,8 +538,8 @@ NTSTATUS macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handles, if (process_events(data->queue, event_mask)) ret = count - 1; else if (count || !timeout || timeout->QuadPart) { - ret = pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + ret = NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); if (ret == count - 1) process_events(data->queue, event_mask); } else ret = WAIT_TIMEOUT; diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 72bd1cefaeb..7cb1665a8fc 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -42,9 +42,6 @@ extern BOOL allow_set_gamma DECLSPEC_HIDDEN; extern BOOL allow_software_rendering DECLSPEC_HIDDEN; extern BOOL disable_window_decorations DECLSPEC_HIDDEN;
-extern NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN, - BOOLEAN,const LARGE_INTEGER*) DECLSPEC_HIDDEN; - extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
static inline CGRect cgrect_from_rect(RECT rect) diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index e1fd7b2d331..4b79c69a6f8 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -69,8 +69,6 @@ int enable_app_nap = FALSE;
CFDictionaryRef localized_strings;
-NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN, - BOOLEAN,const LARGE_INTEGER*);
/************************************************************************** * debugstr_cf @@ -461,7 +459,6 @@ static NTSTATUS macdrv_init(void *arg) init_user_driver(); macdrv_init_display_devices(FALSE);
- pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects; params->unix_call = unix_call; return STATUS_SUCCESS; } diff --git a/dlls/winemac.drv/unixlib.h b/dlls/winemac.drv/unixlib.h index 284a3e26db9..d162732b08e 100644 --- a/dlls/winemac.drv/unixlib.h +++ b/dlls/winemac.drv/unixlib.h @@ -83,7 +83,6 @@ struct localized_string
struct init_params { - NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); struct localized_string *strings; NTSTATUS (CDECL *unix_call)(enum macdrv_funcs code, void *params); }; diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index b7c5692b32d..086a32d2f85 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -67,7 +67,6 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) void **callback_table; struct init_params params = { - NtWaitForMultipleObjects, foreign_window_proc, };
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index cbfb228ea09..ddf5cd0433b 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -483,8 +483,8 @@ NTSTATUS X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, if (!data) { if (!count && timeout && !timeout->QuadPart) return WAIT_TIMEOUT; - return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); }
if (data->current_event) mask = 0; /* don't process nested events */ @@ -492,8 +492,8 @@ NTSTATUS X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, if (process_events( data->display, filter_event, mask )) ret = count - 1; else if (count || !timeout || timeout->QuadPart) { - ret = pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), - !!(flags & MWMO_ALERTABLE), timeout ); + ret = NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), + !!(flags & MWMO_ALERTABLE), timeout ); if (ret == count - 1) process_events( data->display, filter_event, mask ); } else ret = WAIT_TIMEOUT; diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index d490600226f..208c395e02b 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -50,7 +50,6 @@ struct create_desktop_params /* x11drv_init params */ struct init_params { - NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); WNDPROC foreign_window_proc; BOOL show_systray; NTSTATUS (CDECL *unix_call)( enum x11drv_funcs code, void *params ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index f44b3006345..0fe29d8e322 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -446,9 +446,6 @@ extern char *process_name DECLSPEC_HIDDEN; extern Display *clipboard_display DECLSPEC_HIDDEN; extern WNDPROC client_foreign_window_proc;
-extern NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN, - BOOLEAN,const LARGE_INTEGER*) DECLSPEC_HIDDEN; - /* atoms */
enum x11drv_atoms diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 44d4763b316..9e05ebaa9a5 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -220,14 +220,6 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] = "text/uri-list" };
-/* We use use pointer to call NtWaitForMultipleObjects to make it go through - * syscall dispatcher. We need that because win32u bypasses syscall thunks and - * if we called NtWaitForMultipleObjects directly, it wouldn't be able to handle - * user APCs. This will be removed as soon as we may use syscall interface - * for NtUserMsgWaitForMultipleObjectsEx. */ -NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG, const HANDLE *, BOOLEAN, - BOOLEAN, const LARGE_INTEGER* ); - static NTSTATUS CDECL unix_call( enum x11drv_funcs code, void *params );
/*********************************************************************** @@ -686,7 +678,6 @@ static NTSTATUS x11drv_init( void *arg ) if (!XInitThreads()) ERR( "XInitThreads failed, trouble ahead\n" ); if (!(display = XOpenDisplay( NULL ))) return STATUS_UNSUCCESSFUL;
- pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects; client_foreign_window_proc = params->foreign_window_proc;
fcntl( ConnectionNumber(display), F_SETFD, 1 ); /* set close on exec flag */ diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 3842eb3c1da..b5103726e50 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -150,6 +150,7 @@ SYSCALL_ENTRY( NtUserKillTimer ) \ SYSCALL_ENTRY( NtUserLockWindowUpdate ) \ SYSCALL_ENTRY( NtUserMenuItemFromPoint ) \ + SYSCALL_ENTRY( NtUserMsgWaitForMultipleObjectsEx ) \ SYSCALL_ENTRY( NtUserNotifyWinEvent ) \ SYSCALL_ENTRY( NtUserOpenDesktop ) \ SYSCALL_ENTRY( NtUserOpenInputDesktop ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 7ca1e87109d..4e6e86028ba 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -836,6 +836,27 @@ NTSTATUS WINAPI wow64_NtUserMenuItemFromPoint( UINT *args ) return NtUserMenuItemFromPoint( hwnd, handle, x, y ); }
+NTSTATUS WINAPI wow64_NtUserMsgWaitForMultipleObjectsEx( UINT *args ) +{ + DWORD count = get_ulong( &args ); + const ULONG *handles32 = get_ptr( &args ); + DWORD timeout = get_ulong( &args ); + DWORD mask = get_ulong( &args ); + DWORD flags = get_ulong( &args ); + + HANDLE handles[MAXIMUM_WAIT_OBJECTS]; + unsigned int i; + + if (count > ARRAYSIZE(handles)) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return WAIT_FAILED; + } + for (i = 0; i < count; i++) handles[i] = UlongToHandle( handles32[i] ); + + return NtUserMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags ); +} + NTSTATUS WINAPI wow64_NtUserNotifyWinEvent( UINT *args ) { DWORD event = get_ulong( &args );