mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-18 19:10:37 +00:00
engine: platform: win32: replace va function calls.
This commit is contained in:
parent
b648c74815
commit
249ce6bca1
@ -354,6 +354,7 @@ static void ListMissingModules( dll_user_t *hInst )
|
|||||||
PIMAGE_NT_HEADERS peHeader;
|
PIMAGE_NT_HEADERS peHeader;
|
||||||
PIMAGE_IMPORT_DESCRIPTOR importDesc;
|
PIMAGE_IMPORT_DESCRIPTOR importDesc;
|
||||||
byte *data;
|
byte *data;
|
||||||
|
char buf[MAX_VA_STRING];
|
||||||
|
|
||||||
if ( !hInst ) return;
|
if ( !hInst ) return;
|
||||||
|
|
||||||
@ -374,7 +375,10 @@ static void ListMissingModules( dll_user_t *hInst )
|
|||||||
|
|
||||||
hMod = LoadLibraryEx( importName, NULL, LOAD_LIBRARY_AS_DATAFILE );
|
hMod = LoadLibraryEx( importName, NULL, LOAD_LIBRARY_AS_DATAFILE );
|
||||||
if ( !hMod )
|
if ( !hMod )
|
||||||
COM_PushLibraryError( va( "%s not found!", importName ) );
|
{
|
||||||
|
Q_snprintf( buf, sizeof( buf ), "%s not found!", importName );
|
||||||
|
COM_PushLibraryError( buf );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
FreeLibrary( hMod );
|
FreeLibrary( hMod );
|
||||||
}
|
}
|
||||||
@ -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 )
|
void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean directpath )
|
||||||
{
|
{
|
||||||
dll_user_t *hInst;
|
dll_user_t *hInst;
|
||||||
|
char buf[MAX_VA_STRING];
|
||||||
|
|
||||||
COM_ResetLibraryError();
|
COM_ResetLibraryError();
|
||||||
|
|
||||||
hInst = FS_FindLibrary( dllname, directpath );
|
hInst = FS_FindLibrary( dllname, directpath );
|
||||||
if( !hInst )
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 );
|
||||||
COM_FreeLibrary( hInst );
|
COM_FreeLibrary( hInst );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -480,7 +487,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
|
|||||||
{
|
{
|
||||||
if( !LibraryLoadSymbols( hInst ))
|
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 );
|
COM_FreeLibrary( hInst );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user