From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/dllmain.c | 14 +++++++------- dlls/winex11.drv/unixlib.h | 16 ++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/x11drv_main.c | 24 +++++++++++++++++++++++- 4 files changed, 46 insertions(+), 9 deletions(-)
diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 84c20217c78..6a9f4a57273 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -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( ¶ms ); + return X11DRV_CALL( clipboard_message, ¶ms ); }
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( ¶ms ); + return X11DRV_CALL( create_desktop, ¶ms ); }
/*********************************************************************** @@ -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( ¶ms ); + return X11DRV_CALL( tablet_info, ¶ms ); } diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index 231beb055dc..062bb59c663 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -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 { diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 5f49f609e1e..08bfa6dd1d5 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -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; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index eb11b532af7..cc565bd30a7 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -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 ); +}