dbus/dbus-sysdeps-win.h: add _dbus_win_get_dll-module (cherry picked from commit...
authorTor Lillqvist <tml@iki.fi>
Wed, 22 Apr 2009 08:48:59 +0000 (10:48 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 30 Nov 2009 12:14:19 +0000 (13:14 +0100)
dbus/dbus-sysdeps-thread-win.c
dbus/dbus-sysdeps-win.h

index a4f45c0..891b1bb 100644 (file)
@@ -36,6 +36,14 @@ struct DBusCondVar {
 static DWORD dbus_cond_event_tls = TLS_OUT_OF_INDEXES;
 
 
+static HMODULE dbus_dll_hmodule;
+
+void *
+_dbus_win_get_dll_hmodule (void)
+{
+  return dbus_dll_hmodule;
+}
+
 BOOL WINAPI DllMain (HINSTANCE hinstDLL,
                     DWORD     fdwReason,
                     LPVOID    lpvReserved);
@@ -49,6 +57,9 @@ DllMain (HINSTANCE hinstDLL,
   HANDLE event;
   switch (fdwReason) 
     { 
+    case DLL_PROCESS_ATTACH:
+      dbus_dll_hmodule = hinstDLL;
+      break;
     case DLL_THREAD_DETACH:
       if (dbus_cond_event_tls != TLS_OUT_OF_INDEXES)
        {
index 161a819..032b9a2 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef DBUS_SYSDEPS_WIN_H
 #define DBUS_SYSDEPS_WIN_H
 
+extern void *_dbus_win_get_dll_hmodule (void);
 #define _WINSOCKAPI_
 
 #include "dbus-hash.h"