]> granicus.if.org Git - graphviz/commitdiff
get libgvc module via entry point (gvconfig_libdir) instead of module name (gvc.dll)
authorglenlow <devnull@localhost>
Mon, 19 May 2008 03:14:23 +0000 (03:14 +0000)
committerglenlow <devnull@localhost>
Mon, 19 May 2008 03:14:23 +0000 (03:14 +0000)
lib/gvc/gvconfig.c

index ea04fe5ded6177c3dca2d052a83f6db5dad3940a..c7716d94552d9e5e5988a7ebcc48aaedea0eaa77 100644 (file)
@@ -273,12 +273,13 @@ char * gvconfig_libdir(void)
 #ifdef WIN32
            int r;
            char* s;
-           HMODULE hm = GetModuleHandle ("gvc");
-           if (!hm) {
+               
+               MEMORY_BASIC_INFORMATION mbi;
+               if (VirtualQuery (&gvconfig_libdir, &mbi, sizeof(mbi)) == 0) {
                agerr(AGERR,"failed to get handle for executable.\n");
                return 0;
            }
-           r = GetModuleFileName (hm, line, BSZ);
+           r = GetModuleFileName ((HMODULE)mbi.AllocationBase, line, BSZ);
            if (!r || (r == BSZ)) {
                agerr(AGERR,"failed to get path for executable.\n");
                return 0;