Commit 0e5f84a1 authored by Alexandre Julliard's avatar Alexandre Julliard

wintab32: Retrieve the graphics driver module from gdi32.

parent a73c5d5c
MODULE = wintab32.dll MODULE = wintab32.dll
IMPORTLIB = wintab32 IMPORTLIB = wintab32
IMPORTS = user32 IMPORTS = user32 gdi32
C_SRCS = \ C_SRCS = \
context.c \ context.c \
......
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "winerror.h" #include "winerror.h"
#define NOFIX32
#include "wintab.h" #include "wintab.h"
#include "wintab_internal.h" #include "wintab_internal.h"
#include "wine/gdi_driver.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wintab32); WINE_DEFAULT_DEBUG_CHANNEL(wintab32);
...@@ -72,7 +74,6 @@ static VOID TABLET_Unregister(void) ...@@ -72,7 +74,6 @@ static VOID TABLET_Unregister(void)
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved) BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
{ {
static const WCHAR name[] = {'T','a','b','l','e','t',0}; static const WCHAR name[] = {'T','a','b','l','e','t',0};
HMODULE hx11drv;
TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved); TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
switch (fdwReason) switch (fdwReason)
...@@ -80,16 +81,19 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved) ...@@ -80,16 +81,19 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
TRACE("Initialization\n"); TRACE("Initialization\n");
DisableThreadLibraryCalls(hInstDLL); DisableThreadLibraryCalls(hInstDLL);
hx11drv = GetModuleHandleA("winex11.drv"); TABLET_Register();
if (hx11drv) hwndDefault = CreateWindowW(WC_TABLETCLASSNAME, name,
WS_POPUPWINDOW,0,0,0,0,0,0,hInstDLL,0);
if (hwndDefault)
{ {
pLoadTabletInfo = (void *)GetProcAddress(hx11drv, "LoadTabletInfo"); HDC hdc = GetDC( hwndDefault );
pAttachEventQueueToTablet = (void *)GetProcAddress(hx11drv, "AttachEventQueueToTablet"); HMODULE module = __wine_get_driver_module( hdc );
pGetCurrentPacket = (void *)GetProcAddress(hx11drv, "GetCurrentPacket");
pWTInfoW = (void *)GetProcAddress(hx11drv, "WTInfoW"); pLoadTabletInfo = (void *)GetProcAddress(module, "LoadTabletInfo");
TABLET_Register(); pAttachEventQueueToTablet = (void *)GetProcAddress(module, "AttachEventQueueToTablet");
hwndDefault = CreateWindowW(WC_TABLETCLASSNAME, name, pGetCurrentPacket = (void *)GetProcAddress(module, "GetCurrentPacket");
WS_POPUPWINDOW,0,0,0,0,0,0,hInstDLL,0); pWTInfoW = (void *)GetProcAddress(module, "WTInfoW");
ReleaseDC( hwndDefault, hdc );
} }
else else
return FALSE; return FALSE;
......
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