2 * winex11.drv entry points
4 * Copyright 2022 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "x11drv_dll.h"
22 #include "wine/debug.h"
25 HMODULE x11drv_module
= 0;
28 static const KERNEL_CALLBACK_PROC kernel_callbacks
[] =
30 x11drv_dnd_enter_event
,
31 x11drv_dnd_position_event
,
33 x11drv_dnd_drop_event
,
34 x11drv_dnd_leave_event
,
37 C_ASSERT( NtUserDriverCallbackFirst
+ ARRAYSIZE(kernel_callbacks
) == client_func_last
);
40 BOOL WINAPI
DllMain( HINSTANCE instance
, DWORD reason
, void *reserved
)
42 KERNEL_CALLBACK_PROC
*callback_table
;
43 struct init_params params
=
48 if (reason
!= DLL_PROCESS_ATTACH
) return TRUE
;
50 DisableThreadLibraryCalls( instance
);
51 x11drv_module
= instance
;
52 if (__wine_init_unix_call()) return FALSE
;
53 if (X11DRV_CALL( init
, ¶ms
)) return FALSE
;
55 callback_table
= NtCurrentTeb()->Peb
->KernelCallbackTable
;
56 memcpy( callback_table
+ NtUserDriverCallbackFirst
, kernel_callbacks
, sizeof(kernel_callbacks
) );
60 /***********************************************************************
61 * AttachEventQueueToTablet (winex11.@)
63 int CDECL
X11DRV_AttachEventQueueToTablet( HWND owner
)
65 return X11DRV_CALL( tablet_attach_queue
, owner
);
68 /***********************************************************************
69 * GetCurrentPacket (winex11.@)
71 int CDECL
X11DRV_GetCurrentPacket( void *packet
)
73 return X11DRV_CALL( tablet_get_packet
, packet
);
76 /***********************************************************************
77 * LoadTabletInfo (winex11.@)
79 BOOL CDECL
X11DRV_LoadTabletInfo( HWND hwnd
)
81 return X11DRV_CALL( tablet_load_info
, hwnd
);
84 /***********************************************************************
87 UINT CDECL
X11DRV_WTInfoW( UINT category
, UINT index
, void *output
)
89 struct tablet_info_params params
;
90 params
.category
= category
;
92 params
.output
= output
;
93 return X11DRV_CALL( tablet_info
, ¶ms
);