From: Jacek Caban <jacek(a)codeweavers.com> --- dlls/hidclass.sys/device.c | 2 +- dlls/hidclass.sys/pnp.c | 2 +- dlls/win32u/Makefile.in | 3 +-- dlls/win32u/dc.c | 2 +- dlls/win32u/gdiobj.c | 14 ---------- dlls/win32u/input.c | 2 +- dlls/win32u/main.c | 3 --- dlls/win32u/syscall.c | 4 ++- dlls/win32u/win32u.spec | 9 +++---- dlls/win32u/win32u_private.h | 10 -------- dlls/win32u/wrappers.c | 50 ------------------------------------ dlls/wow64win/gdi.c | 20 +++++++++++++++ dlls/wow64win/syscall.h | 5 +++- dlls/wow64win/user.c | 6 +++++ include/ntgdi.h | 3 +-- include/ntuser.h | 3 +++ include/winuser.h | 1 - 17 files changed, 45 insertions(+), 94 deletions(-) delete mode 100644 dlls/win32u/wrappers.c diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index ac201afeddf..d673a8c2e88 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include "hid.h" #include "winreg.h" -#include "winuser.h" +#include "ntuser.h" #include "ddk/hidsdi.h" #include "ddk/hidtypes.h" diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index c0e2a874788..ab3cd5b2cb5 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -29,7 +29,7 @@ #include "ddk/hidtypes.h" #include "ddk/wdm.h" #include "regstr.h" -#include "winuser.h" +#include "ntuser.h" #include "wine/debug.h" #include "wine/asm.h" #include "wine/list.h" diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in index 7274f132fa5..8e687a0b85f 100644 --- a/dlls/win32u/Makefile.in +++ b/dlls/win32u/Makefile.in @@ -53,7 +53,6 @@ C_SRCS = \ vertical.c \ vulkan.c \ window.c \ - winstation.c \ - wrappers.c + winstation.c font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\" diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 9e8e2f65212..0b7d2cd023d 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -1473,7 +1473,7 @@ DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout ) /********************************************************************** * __wine_get_icm_profile (win32u.@) */ -BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ) +BOOL WINAPI __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ) { PHYSDEV physdev; DC *dc; diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 22cd7dd03ba..2201ac4b01e 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1027,14 +1027,6 @@ BOOL WINAPI NtGdiSetColorAdjustment( HDC hdc, const COLORADJUSTMENT *ca ) return FALSE; } - -static struct unix_funcs unix_funcs = -{ - __wine_get_file_outline_text_metric, - __wine_get_icm_profile, - __wine_send_input, -}; - void gdi_init(void) { pthread_mutexattr_t attr; @@ -1052,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/input.c b/dlls/win32u/input.c index fb9824759b2..868f0ef697e 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -598,7 +598,7 @@ BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ) * * Internal SendInput function to allow the graphics driver to inject real events. */ -BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ) +BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ) { return set_ntstatus( send_hardware_message( hwnd, input, rawinput, 0 )); } diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 3d6a9c2d038..e3d2f2c54b2 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -55,10 +55,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) if (__wine_syscall_dispatcher) break; /* already set through Wow64Transition */ if (!NtQueryVirtualMemory( GetCurrentProcess(), inst, MemoryWineUnixFuncs, &win32u_handle, sizeof(win32u_handle), NULL )) - { __wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher ); - wrappers_init( win32u_handle ); - } break; } return TRUE; diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 5e342342362..3f75424203a 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -432,6 +432,9 @@ static void * const syscalls[] = NtUserWaitMessage, NtUserWindowFromDC, NtUserWindowFromPoint, + __wine_get_file_outline_text_metric, + __wine_get_icm_profile, + __wine_send_input }; static BYTE arguments[ARRAY_SIZE(syscalls)]; @@ -452,5 +455,4 @@ static NTSTATUS init( void *dispatcher ) unixlib_entry_t __wine_unix_call_funcs[] = { init, - callbacks_init, }; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 178329d6858..b7d364a4e09 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1320,9 +1320,6 @@ ################################################################ # Wine internal extensions -# Graphics drivers -@ cdecl __wine_send_input(long ptr ptr) - -# gdi32 -@ cdecl __wine_get_icm_profile(long long ptr ptr) -@ stdcall __wine_get_file_outline_text_metric(wstr ptr ptr ptr) +@ stdcall -syscall __wine_get_icm_profile(long long ptr ptr) +@ stdcall -syscall __wine_get_file_outline_text_metric(wstr ptr ptr ptr) +@ stdcall -syscall __wine_send_input(long ptr ptr) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index e7e77bf2427..670fd3b91d8 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -32,14 +32,6 @@ #include "wine/debug.h" #include "wine/server.h" -struct unix_funcs -{ - /* Wine-specific functions */ - BOOL (WINAPI *get_file_outline_text_metric)( const WCHAR *path, TEXTMETRICW *otm, - UINT *em_square, WCHAR *face_name ); - BOOL (CDECL *get_icm_profile)( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ); - BOOL (CDECL *wine_send_input)( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ); -}; /* clipboard.c */ extern UINT enum_clipboard_formats( UINT format ) DECLSPEC_HIDDEN; @@ -247,9 +239,7 @@ 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; extern void sysparams_init(void) DECLSPEC_HIDDEN; extern int muldiv( int a, int b, int c ) DECLSPEC_HIDDEN; diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c deleted file mode 100644 index 23dccd55bf1..00000000000 --- a/dlls/win32u/wrappers.c +++ /dev/null @@ -1,50 +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" - -static const struct unix_funcs *unix_funcs; - -BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ) -{ - if (!unix_funcs) return FALSE; - return unix_funcs->get_icm_profile( hdc, allow_default, size, filename ); -} - -BOOL WINAPI __wine_get_file_outline_text_metric( const WCHAR *path, TEXTMETRICW *otm, - UINT *em_square, WCHAR *face_name ) -{ - if (!unix_funcs) return FALSE; - return unix_funcs->get_file_outline_text_metric( path, otm, em_square, face_name ); -} - -BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ) -{ - if (!unix_funcs) 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; -} diff --git a/dlls/wow64win/gdi.c b/dlls/wow64win/gdi.c index b1c79c776d7..c846e47ba5e 100644 --- a/dlls/wow64win/gdi.c +++ b/dlls/wow64win/gdi.c @@ -2081,3 +2081,23 @@ NTSTATUS WINAPI wow64_NtGdiWidenPath( UINT *args ) return NtGdiWidenPath( hdc ); } + +NTSTATUS WINAPI wow64___wine_get_icm_profile( UINT *args ) +{ + HDC hdc = get_handle( &args ); + BOOL allow_default = get_ulong( &args ); + DWORD *size = get_ptr( &args ); + WCHAR *filename = get_ptr( &args ); + + return __wine_get_icm_profile( hdc, allow_default, size, filename ); +} + +NTSTATUS WINAPI wow64___wine_get_file_outline_text_metric( UINT *args ) +{ + const WCHAR *path = get_ptr( &args ); + TEXTMETRICW *otm = get_ptr( &args ); + UINT *em_square = get_ptr( &args ); + WCHAR *face_name = get_ptr( &args ); + + return __wine_get_file_outline_text_metric( path, otm, em_square, face_name ); +} diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 0521ad900d8..121b0701538 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -417,6 +417,9 @@ SYSCALL_ENTRY( NtUserWaitForInputIdle ) \ SYSCALL_ENTRY( NtUserWaitMessage ) \ SYSCALL_ENTRY( NtUserWindowFromDC ) \ - SYSCALL_ENTRY( NtUserWindowFromPoint ) + SYSCALL_ENTRY( NtUserWindowFromPoint ) \ + SYSCALL_ENTRY( __wine_get_file_outline_text_metric ) \ + SYSCALL_ENTRY( __wine_get_icm_profile ) \ + SYSCALL_ENTRY( __wine_send_input ) #endif /* __WOW64WIN_SYSCALL_H */ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 627de08b777..7c9a973b2a5 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -4342,3 +4342,9 @@ NTSTATUS WINAPI wow64_NtUserDisplayConfigGetDeviceInfo( UINT *args ) return NtUserDisplayConfigGetDeviceInfo( packet ); } + +NTSTATUS WINAPI wow64___wine_send_input( UINT *args ) +{ + ERR( "not supported\n "); + return 0; +} diff --git a/include/ntgdi.h b/include/ntgdi.h index 1ac8e0110e2..55c6739a54f 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -483,8 +483,7 @@ NTSTATUS WINAPI NtGdiDdDDISetQueuedLimit( D3DKMT_SETQUEUEDLIMIT *desc ); NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc ); /* Wine extensions */ -extern BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, - WCHAR *filename ); +BOOL WINAPI __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename ); BOOL WINAPI __wine_get_file_outline_text_metric( const WCHAR *path, TEXTMETRICW *otm, UINT *em_square, WCHAR *face_name ); diff --git a/include/ntuser.h b/include/ntuser.h index 28ce230334a..be040682e96 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1527,4 +1527,7 @@ static inline BOOL NtUserShowOwnedPopups( HWND hwnd, BOOL show ) return NtUserCallHwndParam( hwnd, show, NtUserCallHwndParam_ShowOwnedPopups ); } +/* Wine extensions */ +BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ); + #endif /* _NTUSER_ */ diff --git a/include/winuser.h b/include/winuser.h index d1e03461d07..1d0455c8adf 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -4765,7 +4765,6 @@ static inline BOOL WINAPI SetRectEmpty(LPRECT rect) WORD WINAPI SYSTEM_KillSystemTimer( WORD ); #ifdef __WINESRC__ -WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ); /* Uxtheme hook functions and struct */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2922