File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -377,9 +377,24 @@ bool CSteamClient::Load()
377
377
return false ;
378
378
}
379
379
380
+ static auto pAddDllDirectory = ([]() -> decltype (&AddDllDirectory) {
381
+ if (const HMODULE kernel32 = GetModuleHandleW (L" kernel32.dll" ); kernel32 != nullptr )
382
+ {
383
+ return reinterpret_cast <decltype (&AddDllDirectory)>(static_cast <void *>(GetProcAddress (kernel32, " AddDllDirectory" )));
384
+ }
385
+
386
+ return nullptr ;
387
+ })();
388
+
389
+ if (pAddDllDirectory == nullptr )
390
+ {
391
+ WriteErrorEvent (" Your operating system is outdated and is missing the KB2533623 update package for AddDllDirectory" );
392
+ return false ;
393
+ }
394
+
380
395
WriteDebugEvent (SString (" Using steamclient.dll: %s" , *ToUTF8 (steamClientPath.value ())));
381
396
SetEnvironmentVariableW (L" SteamAppId" , L" " STEAM_GTASA_APP_ID);
382
- AddDllDirectory (steamDirPath.c_str ());
397
+ pAddDllDirectory (steamDirPath.c_str ());
383
398
{
384
399
static wchar_t pathBuffer[65536 ];
385
400
GetEnvironmentVariableW (L" PATH" , pathBuffer, sizeof (pathBuffer) / sizeof (wchar_t ));
@@ -425,7 +440,7 @@ bool CSteamClient::Load()
425
440
426
441
releaseLibraryLock.reset ();
427
442
428
- Native::CreateInterface = reinterpret_cast <decltype (Native::CreateInterface)>(GetProcAddress (dll, " CreateInterface" ));
443
+ Native::CreateInterface = reinterpret_cast <decltype (Native::CreateInterface)>(static_cast < void *>( GetProcAddress (dll, " CreateInterface" ) ));
429
444
430
445
if (!Native::CreateInterface)
431
446
{
You can’t perform that action at this time.
0 commit comments