mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 01:01:44 +00:00
win32u: Use syscall interface for all exports.
This commit is contained in:
parent
da4663d640
commit
b601e3fa97
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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}`\"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 ));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue