winex11: Introduce X11DRV_CALL macro.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-05-02 21:15:10 +02:00 committed by Alexandre Julliard
parent 27b151763d
commit 095773b36a
4 changed files with 46 additions and 9 deletions

View File

@ -76,7 +76,7 @@ static LRESULT CALLBACK clipboard_wndproc( HWND hwnd, UINT msg, WPARAM wp, LPARA
params.msg = msg;
params.wparam = wp;
params.lparam = lp;
return x11drv_clipboard_message( &params );
return X11DRV_CALL( clipboard_message, &params );
}
return DefWindowProcW( hwnd, msg, wp, lp );
@ -132,7 +132,7 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
DisableThreadLibraryCalls( instance );
x11drv_module = instance;
return !x11drv_init( NULL );
return !X11DRV_CALL( init, NULL );
}
@ -142,7 +142,7 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
BOOL CDECL wine_create_desktop( UINT width, UINT height )
{
struct create_desktop_params params = { .width = width, .height = height };
return x11drv_create_desktop( &params );
return X11DRV_CALL( create_desktop, &params );
}
/***********************************************************************
@ -150,7 +150,7 @@ BOOL CDECL wine_create_desktop( UINT width, UINT height )
*/
int CDECL X11DRV_AttachEventQueueToTablet( HWND owner )
{
return x11drv_tablet_attach_queue( owner );
return X11DRV_CALL( tablet_attach_queue, owner );
}
/***********************************************************************
@ -158,7 +158,7 @@ int CDECL X11DRV_AttachEventQueueToTablet( HWND owner )
*/
int CDECL X11DRV_GetCurrentPacket( void *packet )
{
return x11drv_tablet_get_packet( packet );
return X11DRV_CALL( tablet_get_packet, packet );
}
/***********************************************************************
@ -166,7 +166,7 @@ int CDECL X11DRV_GetCurrentPacket( void *packet )
*/
BOOL CDECL X11DRV_LoadTabletInfo( HWND hwnd )
{
return x11drv_tablet_load_info( hwnd );
return X11DRV_CALL( tablet_load_info, hwnd );
}
/***********************************************************************
@ -178,5 +178,5 @@ UINT CDECL X11DRV_WTInfoW( UINT category, UINT index, void *output )
params.category = category;
params.index = index;
params.output = output;
return x11drv_tablet_info( &params );
return X11DRV_CALL( tablet_info, &params );
}

View File

@ -19,6 +19,22 @@
#include "ntuser.h"
#include "wine/unixlib.h"
enum x11drv_funcs
{
unix_clipboard_message,
unix_create_desktop,
unix_init,
unix_tablet_attach_queue,
unix_tablet_get_packet,
unix_tablet_info,
unix_tablet_load_info,
unix_funcs_count,
};
/* FIXME: Use __wine_unix_call when the rest of the stack is ready */
extern NTSTATUS x11drv_unix_call( enum x11drv_funcs code, void *params ) DECLSPEC_HIDDEN;
#define X11DRV_CALL(func, params) x11drv_unix_call( unix_ ## func, params )
/* x11drv_clipboard_message params */
struct clipboard_message_params
{

View File

@ -843,7 +843,6 @@ static inline BOOL is_window_rect_mapped( const RECT *rect )
/* unixlib interface */
extern NTSTATUS x11drv_init( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_clipboard_message( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_create_desktop( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_tablet_attach_queue( void *arg ) DECLSPEC_HIDDEN;

View File

@ -629,7 +629,7 @@ static void init_visuals( Display *display, int screen )
/***********************************************************************
* X11DRV process initialisation routine
*/
NTSTATUS x11drv_init( void *arg )
static NTSTATUS x11drv_init( void *arg )
{
Display *display;
void *libx11 = dlopen( SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL );
@ -951,3 +951,25 @@ NTSTATUS CDECL X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDP
pthread_mutex_unlock( &d3dkmt_mutex );
return STATUS_SUCCESS;
}
const unixlib_entry_t __wine_unix_call_funcs[] =
{
x11drv_clipboard_message,
x11drv_create_desktop,
x11drv_init,
x11drv_tablet_attach_queue,
x11drv_tablet_get_packet,
x11drv_tablet_info,
x11drv_tablet_load_info,
};
C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
/* FIXME: Use __wine_unix_call instead */
NTSTATUS x11drv_unix_call( enum x11drv_funcs code, void *params )
{
return __wine_unix_call_funcs[code]( params );
}