Alexandre Julliard : wintab32: Retrieve the graphics driver module from gdi32.

Alexandre Julliard julliard at winehq.org
Wed Feb 6 13:38:12 CST 2013


Module: wine
Branch: master
Commit: 0e5f84a148a33f60567bc29a8ae371ac572adc81
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0e5f84a148a33f60567bc29a8ae371ac572adc81

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb  6 13:19:43 2013 +0100

wintab32: Retrieve the graphics driver module from gdi32.

---

 dlls/wintab32/Makefile.in |    2 +-
 dlls/wintab32/wintab32.c  |   24 ++++++++++++++----------
 2 files changed, 15 insertions(+), 11 deletions(-)

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




More information about the wine-cvs mailing list