diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in index 7274f132fa53..93b8c75cc7b8 100644 --- a/dlls/win32u/Makefile.in +++ b/dlls/win32u/Makefile.in @@ -54,6 +54,5 @@ C_SRCS = \ vulkan.c \ window.c \ winstation.c \ - wrappers.c font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\" diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 122db5a2112c..2201ac4b01e1 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1027,12 +1027,6 @@ BOOL WINAPI NtGdiSetColorAdjustment( HDC hdc, const COLORADJUSTMENT *ca ) return FALSE; } - -static struct unix_funcs unix_funcs = -{ - __wine_send_input, -}; - void gdi_init(void) { pthread_mutexattr_t attr; @@ -1050,9 +1044,3 @@ void gdi_init(void) dpi = font_init(); init_stock_objects( dpi ); } - -NTSTATUS callbacks_init( void *args ) -{ - *(const struct unix_funcs **)args = &unix_funcs; - return 0; -} diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 3d6a9c2d0383..598f2ad43c3e 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -57,9 +57,14 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) &win32u_handle, sizeof(win32u_handle), NULL )) { __wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher ); - wrappers_init( win32u_handle ); } break; } return TRUE; } + +BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ) +{ + struct __wine_send_input_params params = { hwnd, input, rawinput }; + return (BOOL)__wine_unix_call( win32u_handle, 1, ¶ms); +} \ No newline at end of file diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index abd7e964e169..27ae895a47ce 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -451,10 +451,16 @@ static NTSTATUS init( void *dispatcher ) return ntdll_init_syscalls( 1, &syscall_table, dispatcher ); } +static NTSTATUS win32u_send_input(void *args) +{ + struct __wine_send_input_params *params = (struct __wine_send_input_params *)args; + return (NTSTATUS)__wine_send_input(params->hwnd, params->input, params->rawinput); +} + unixlib_entry_t __wine_unix_call_funcs[] = { init, - callbacks_init, + win32u_send_input, }; #ifdef _WIN64 diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index dc1e4657d1eb..e64b083a33ea 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -32,10 +32,11 @@ #include "wine/debug.h" #include "wine/server.h" -struct unix_funcs +struct __wine_send_input_params { - /* Wine-specific functions */ - BOOL (CDECL *wine_send_input)( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ); + HWND hwnd; + const INPUT *input; + const RAWINPUT *rawinput; }; /* clipboard.c */ @@ -244,7 +245,6 @@ static inline void release_win_ptr( struct tagWND *ptr ) user_unlock(); } -extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN; extern void gdi_init(void) DECLSPEC_HIDDEN; extern NTSTATUS callbacks_init( void *args ) DECLSPEC_HIDDEN; extern void winstation_init(void) DECLSPEC_HIDDEN; diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c deleted file mode 100644 index 248310ef0ef5..000000000000 --- a/dlls/win32u/wrappers.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Unix call wrappers - * - * Copyright 2021 Jacek Caban for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "win32u_private.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(wow); - - -static const struct unix_funcs *unix_funcs; - - -BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ) -{ - if (!unix_funcs) - { - ERR( "should not be used in wow64\n" ); - return FALSE; - } - return unix_funcs->wine_send_input( hwnd, input, rawinput ); -} - -extern void wrappers_init( unixlib_handle_t handle ) -{ - const void *args; - if (!__wine_unix_call( handle, 1, &args )) unix_funcs = args; -}