#include <string.h>
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+ #include <windows.h>
+#endif
+
#include <libgda/sql-parser/gda-sql-parser.h>
#include "libzakaudit.h"
/* PRIVATE */
G_DEFINE_TYPE (ZakAudit, zak_audit, G_TYPE_OBJECT)
+#ifdef G_OS_WIN32
+static HMODULE backend_dll = NULL;
+
+BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ backend_dll = (HMODULE) hinstDLL;
+ break;
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+#endif
+
static void
zak_audit_class_init (ZakAuditClass *klass)
{
gchar *moddir;
gchar *p;
- moddir = g_win32_get_package_installation_directory_of_module (NULL);
+ moddir = g_win32_get_package_installation_directory_of_module (backend_dll);
p = g_strrstr (moddir, g_strdup_printf ("%c", G_DIR_SEPARATOR));
if (p != NULL
/*
* test1.c
*
- * Copyright (C) 2005-2014 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2005-2015 Andrea Zagli <azagli@libero.it>
*
* This file is part of libaudit.
*