|
|
@ -82,6 +82,7 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d |
|
|
|
{ |
|
|
|
{ |
|
|
|
dll_user_t *hInst = NULL; |
|
|
|
dll_user_t *hInst = NULL; |
|
|
|
void *pHandle = NULL; |
|
|
|
void *pHandle = NULL; |
|
|
|
|
|
|
|
char buf[MAX_VA_STRING]; |
|
|
|
|
|
|
|
|
|
|
|
COM_ResetLibraryError(); |
|
|
|
COM_ResetLibraryError(); |
|
|
|
|
|
|
|
|
|
|
@ -110,7 +111,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d |
|
|
|
if( pHandle ) |
|
|
|
if( pHandle ) |
|
|
|
return pHandle; |
|
|
|
return pHandle; |
|
|
|
|
|
|
|
|
|
|
|
COM_PushLibraryError( va( "Failed to find library %s", dllname )); |
|
|
|
Q_snprintf( buf, sizeof( buf ), "Failed to find library %s", dllname ); |
|
|
|
|
|
|
|
COM_PushLibraryError( buf ); |
|
|
|
COM_PushLibraryError( dlerror() ); |
|
|
|
COM_PushLibraryError( dlerror() ); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
@ -118,7 +120,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d |
|
|
|
|
|
|
|
|
|
|
|
if( hInst->custom_loader ) |
|
|
|
if( hInst->custom_loader ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
COM_PushLibraryError( va( "Custom library loader is not available. Extract library %s and fix gameinfo.txt!", hInst->fullPath )); |
|
|
|
Q_snprintf( buf, sizeof( buf ), "Custom library loader is not available. Extract library %s and fix gameinfo.txt!", hInst->fullPath ); |
|
|
|
|
|
|
|
COM_PushLibraryError( buf ); |
|
|
|
Mem_Free( hInst ); |
|
|
|
Mem_Free( hInst ); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
@ -128,14 +131,16 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( hInst->encrypted ) |
|
|
|
if( hInst->encrypted ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
COM_PushLibraryError( va( "Library %s is encrypted. Cannot load", hInst->shortPath ) ); |
|
|
|
Q_snprintf( buf, sizeof( buf ), "Library %s is encrypted. Cannot load", hInst->shortPath ); |
|
|
|
|
|
|
|
COM_PushLibraryError( buf ); |
|
|
|
Mem_Free( hInst ); |
|
|
|
Mem_Free( hInst ); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( !( hInst->hInstance = Loader_LoadLibrary( hInst->fullPath ) ) ) |
|
|
|
if( !( hInst->hInstance = Loader_LoadLibrary( hInst->fullPath ) ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
COM_PushLibraryError( va( "Failed to load DLL with DLL loader: %s", hInst->shortPath ) ); |
|
|
|
Q_snprintf( buf, sizeof( buf ), "Failed to load DLL with DLL loader: %s", hInst->shortPath ); |
|
|
|
|
|
|
|
COM_PushLibraryError( buf ); |
|
|
|
Mem_Free( hInst ); |
|
|
|
Mem_Free( hInst ); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|