File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,22 @@ static void *load_library(const char *name)
56
56
dll_path [len ] = '/' ;
57
57
memcpy (dll_path + len + 1 , name , name_size );
58
58
59
- if (!access (dll_path , R_OK ))
60
- return (void * )LoadLibraryExA (dll_path , NULL , 0 );
59
+ if (!access (dll_path , R_OK )) {
60
+ void * res = (void * )LoadLibraryExA (dll_path , NULL , 0 );
61
+ if (!res ) {
62
+ DWORD err = GetLastError ();
63
+ char buf [1024 ];
64
+
65
+ if (!FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM |
66
+ FORMAT_MESSAGE_ARGUMENT_ARRAY |
67
+ FORMAT_MESSAGE_IGNORE_INSERTS ,
68
+ NULL , err , LANG_NEUTRAL ,
69
+ buf , sizeof (buf ) - 1 , NULL ))
70
+ xsnprintf (buf , sizeof (buf ), "last error: %ld" , err );
71
+ error ("LoadLibraryExA() failed with: %s" , buf );
72
+ }
73
+ return res ;
74
+ }
61
75
}
62
76
63
77
path = * sep ? sep + 1 : NULL ;
You can’t perform that action at this time.
0 commit comments