Actually my first patch is ok, but this is probably a better one.
Code:
@@ -83,10 +83,10 @@
return(NULL);
void *r = GetProcAddress(hDLL, name);
-
- if(GetError() != NULL)
- r = NULL;
-
+ if ( r == NULL ) {
+ const char *load_error = GetError();
+ fprintf(stderr, "[Error] Shared Library GetSym: '%s' failed. Error=%s\n", name, load_error?load_error:"Null Return, no error");
+ }
return(r);
}