program before searching all the loaded DLLs.
the latter on Win9x and Win2k. Check which one works, and use
that.
+ First check for the symbol in the main program, and if not found
+ there, in all the modules.
+
Code for using PSAPI and Toolhelp was borrowed from the Dr. Mingw
tool written by José Fonseca <em96115@fe.up.pt>. Thanks.
gpointer p;
if (handle == null_module_handle)
- p = find_in_any_module (symbol_name);
+ {
+ if ((p = GetProcAddress (GetModuleHandle (NULL), symbol_name)) == NULL)
+ p = find_in_any_module (symbol_name);
+ }
else
p = GetProcAddress (handle, symbol_name);