Explorar o código

use the actual module handle instead of the calling process handle (windows) (#240)

Dan Korostelev %!s(int64=6) %!d(string=hai) anos
pai
achega
d23e13b1a0
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/module.c

+ 2 - 1
src/module.c

@@ -24,7 +24,8 @@
 
 #ifdef HL_WIN
 #	include <windows.h>
-#	define dlopen(l,p)		(void*)( (l) ? LoadLibraryA(l) : GetModuleHandle(NULL))
+EXTERN_C IMAGE_DOS_HEADER __ImageBase;
+#	define dlopen(l,p)		(void*)( (l) ? LoadLibraryA(l) : (HMODULE)&__ImageBase)
 #	define dlsym(h,n)		GetProcAddress((HANDLE)h,n)
 #else
 #	include <dlfcn.h>