Browse Source

engine: platform: win32: replace va function calls.

pull/2/head
Andrey Akhmichin 2 years ago committed by Alibek Omarov
parent
commit
249ce6bca1
  1. 16
      engine/platform/win32/lib_win.c

16
engine/platform/win32/lib_win.c

@ -354,6 +354,7 @@ static void ListMissingModules( dll_user_t *hInst ) @@ -354,6 +354,7 @@ static void ListMissingModules( dll_user_t *hInst )
PIMAGE_NT_HEADERS peHeader;
PIMAGE_IMPORT_DESCRIPTOR importDesc;
byte *data;
char buf[MAX_VA_STRING];
if ( !hInst ) return;
@ -374,7 +375,10 @@ static void ListMissingModules( dll_user_t *hInst ) @@ -374,7 +375,10 @@ static void ListMissingModules( dll_user_t *hInst )
hMod = LoadLibraryEx( importName, NULL, LOAD_LIBRARY_AS_DATAFILE );
if ( !hMod )
COM_PushLibraryError( va( "%s not found!", importName ) );
{
Q_snprintf( buf, sizeof( buf ), "%s not found!", importName );
COM_PushLibraryError( buf );
}
else
FreeLibrary( hMod );
}
@ -436,19 +440,22 @@ smart dll loader - can loading dlls from pack or wad files @@ -436,19 +440,22 @@ smart dll loader - can loading dlls from pack or wad files
void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean directpath )
{
dll_user_t *hInst;
char buf[MAX_VA_STRING];
COM_ResetLibraryError();
hInst = FS_FindLibrary( dllname, directpath );
if( !hInst )
{
COM_PushLibraryError( va( "Failed to find library %s", dllname ) );
Q_snprintf( buf, sizeof( buf ), "Failed to find library %s", dllname );
COM_PushLibraryError( buf );
return NULL;
}
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 );
COM_FreeLibrary( hInst );
return NULL;
}
@ -480,7 +487,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d @@ -480,7 +487,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
{
if( !LibraryLoadSymbols( hInst ))
{
COM_PushLibraryError( va( "Failed to load library %s", dllname ) );
Q_snprintf( buf, sizeof( buf ), "Failed to load library %s", dllname );
COM_PushLibraryError( buf );
COM_FreeLibrary( hInst );
return NULL;
}

Loading…
Cancel
Save