Commit b601e3fa authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use syscall interface for all exports.

parent da4663d6
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "hid.h" #include "hid.h"
#include "winreg.h" #include "winreg.h"
#include "winuser.h" #include "ntuser.h"
#include "ddk/hidsdi.h" #include "ddk/hidsdi.h"
#include "ddk/hidtypes.h" #include "ddk/hidtypes.h"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "ddk/hidtypes.h" #include "ddk/hidtypes.h"
#include "ddk/wdm.h" #include "ddk/wdm.h"
#include "regstr.h" #include "regstr.h"
#include "winuser.h" #include "ntuser.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/list.h" #include "wine/list.h"
......
...@@ -53,7 +53,6 @@ C_SRCS = \ ...@@ -53,7 +53,6 @@ C_SRCS = \
vertical.c \ vertical.c \
vulkan.c \ vulkan.c \
window.c \ window.c \
winstation.c \ winstation.c
wrappers.c
font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\" font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\"
...@@ -1473,7 +1473,7 @@ DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout ) ...@@ -1473,7 +1473,7 @@ DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout )
/********************************************************************** /**********************************************************************
* __wine_get_icm_profile (win32u.@) * __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; PHYSDEV physdev;
DC *dc; DC *dc;
......
...@@ -1027,14 +1027,6 @@ BOOL WINAPI NtGdiSetColorAdjustment( HDC hdc, const COLORADJUSTMENT *ca ) ...@@ -1027,14 +1027,6 @@ BOOL WINAPI NtGdiSetColorAdjustment( HDC hdc, const COLORADJUSTMENT *ca )
return FALSE; 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) void gdi_init(void)
{ {
pthread_mutexattr_t attr; pthread_mutexattr_t attr;
...@@ -1052,9 +1044,3 @@ void gdi_init(void) ...@@ -1052,9 +1044,3 @@ void gdi_init(void)
dpi = font_init(); dpi = font_init();
init_stock_objects( dpi ); init_stock_objects( dpi );
} }
NTSTATUS callbacks_init( void *args )
{
*(const struct unix_funcs **)args = &unix_funcs;
return 0;
}
...@@ -598,7 +598,7 @@ BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ) ...@@ -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. * 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 )); return set_ntstatus( send_hardware_message( hwnd, input, rawinput, 0 ));
} }
......
...@@ -55,10 +55,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) ...@@ -55,10 +55,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
if (__wine_syscall_dispatcher) break; /* already set through Wow64Transition */ if (__wine_syscall_dispatcher) break; /* already set through Wow64Transition */
if (!NtQueryVirtualMemory( GetCurrentProcess(), inst, MemoryWineUnixFuncs, if (!NtQueryVirtualMemory( GetCurrentProcess(), inst, MemoryWineUnixFuncs,
&win32u_handle, sizeof(win32u_handle), NULL )) &win32u_handle, sizeof(win32u_handle), NULL ))
{
__wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher ); __wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher );
wrappers_init( win32u_handle );
}
break; break;
} }
return TRUE; return TRUE;
......
...@@ -432,6 +432,9 @@ static void * const syscalls[] = ...@@ -432,6 +432,9 @@ static void * const syscalls[] =
NtUserWaitMessage, NtUserWaitMessage,
NtUserWindowFromDC, NtUserWindowFromDC,
NtUserWindowFromPoint, NtUserWindowFromPoint,
__wine_get_file_outline_text_metric,
__wine_get_icm_profile,
__wine_send_input
}; };
static BYTE arguments[ARRAY_SIZE(syscalls)]; static BYTE arguments[ARRAY_SIZE(syscalls)];
...@@ -452,5 +455,4 @@ static NTSTATUS init( void *dispatcher ) ...@@ -452,5 +455,4 @@ static NTSTATUS init( void *dispatcher )
unixlib_entry_t __wine_unix_call_funcs[] = unixlib_entry_t __wine_unix_call_funcs[] =
{ {
init, init,
callbacks_init,
}; };
...@@ -1320,9 +1320,6 @@ ...@@ -1320,9 +1320,6 @@
################################################################ ################################################################
# Wine internal extensions # Wine internal extensions
# Graphics drivers @ stdcall -syscall __wine_get_icm_profile(long long ptr ptr)
@ cdecl __wine_send_input(long ptr ptr) @ stdcall -syscall __wine_get_file_outline_text_metric(wstr ptr ptr ptr)
@ stdcall -syscall __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)
...@@ -32,14 +32,6 @@ ...@@ -32,14 +32,6 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/server.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 */ /* clipboard.c */
extern UINT enum_clipboard_formats( UINT format ) DECLSPEC_HIDDEN; extern UINT enum_clipboard_formats( UINT format ) DECLSPEC_HIDDEN;
...@@ -247,9 +239,7 @@ static inline void release_win_ptr( struct tagWND *ptr ) ...@@ -247,9 +239,7 @@ static inline void release_win_ptr( struct tagWND *ptr )
user_unlock(); user_unlock();
} }
extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN;
extern void gdi_init(void) 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 winstation_init(void) DECLSPEC_HIDDEN;
extern void sysparams_init(void) DECLSPEC_HIDDEN; extern void sysparams_init(void) DECLSPEC_HIDDEN;
extern int muldiv( int a, int b, int c ) DECLSPEC_HIDDEN; extern int muldiv( int a, int b, int c ) DECLSPEC_HIDDEN;
......
/*
* 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;
}
...@@ -2081,3 +2081,23 @@ NTSTATUS WINAPI wow64_NtGdiWidenPath( UINT *args ) ...@@ -2081,3 +2081,23 @@ NTSTATUS WINAPI wow64_NtGdiWidenPath( UINT *args )
return NtGdiWidenPath( hdc ); 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 );
}
...@@ -417,6 +417,9 @@ ...@@ -417,6 +417,9 @@
SYSCALL_ENTRY( NtUserWaitForInputIdle ) \ SYSCALL_ENTRY( NtUserWaitForInputIdle ) \
SYSCALL_ENTRY( NtUserWaitMessage ) \ SYSCALL_ENTRY( NtUserWaitMessage ) \
SYSCALL_ENTRY( NtUserWindowFromDC ) \ 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 */ #endif /* __WOW64WIN_SYSCALL_H */
...@@ -4342,3 +4342,9 @@ NTSTATUS WINAPI wow64_NtUserDisplayConfigGetDeviceInfo( UINT *args ) ...@@ -4342,3 +4342,9 @@ NTSTATUS WINAPI wow64_NtUserDisplayConfigGetDeviceInfo( UINT *args )
return NtUserDisplayConfigGetDeviceInfo( packet ); return NtUserDisplayConfigGetDeviceInfo( packet );
} }
NTSTATUS WINAPI wow64___wine_send_input( UINT *args )
{
ERR( "not supported\n ");
return 0;
}
...@@ -483,8 +483,7 @@ NTSTATUS WINAPI NtGdiDdDDISetQueuedLimit( D3DKMT_SETQUEUEDLIMIT *desc ); ...@@ -483,8 +483,7 @@ NTSTATUS WINAPI NtGdiDdDDISetQueuedLimit( D3DKMT_SETQUEUEDLIMIT *desc );
NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc ); NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc );
/* Wine extensions */ /* Wine extensions */
extern BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, BOOL WINAPI __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename );
WCHAR *filename );
BOOL WINAPI __wine_get_file_outline_text_metric( const WCHAR *path, TEXTMETRICW *otm, BOOL WINAPI __wine_get_file_outline_text_metric( const WCHAR *path, TEXTMETRICW *otm,
UINT *em_square, WCHAR *face_name ); UINT *em_square, WCHAR *face_name );
......
...@@ -1527,4 +1527,7 @@ static inline BOOL NtUserShowOwnedPopups( HWND hwnd, BOOL show ) ...@@ -1527,4 +1527,7 @@ static inline BOOL NtUserShowOwnedPopups( HWND hwnd, BOOL show )
return NtUserCallHwndParam( hwnd, show, NtUserCallHwndParam_ShowOwnedPopups ); return NtUserCallHwndParam( hwnd, show, NtUserCallHwndParam_ShowOwnedPopups );
} }
/* Wine extensions */
BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput );
#endif /* _NTUSER_ */ #endif /* _NTUSER_ */
...@@ -4765,7 +4765,6 @@ static inline BOOL WINAPI SetRectEmpty(LPRECT rect) ...@@ -4765,7 +4765,6 @@ static inline BOOL WINAPI SetRectEmpty(LPRECT rect)
WORD WINAPI SYSTEM_KillSystemTimer( WORD ); WORD WINAPI SYSTEM_KillSystemTimer( WORD );
#ifdef __WINESRC__ #ifdef __WINESRC__
WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput );
/* Uxtheme hook functions and struct */ /* Uxtheme hook functions and struct */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment