Simplify GetModuleHandleEx usage

This commit is contained in:
Silent 2018-10-31 23:43:07 +01:00
parent b3c95bb519
commit 910b9372b5
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1

View file

@ -56,9 +56,8 @@ namespace ModCompat
{
if ( module == nullptr ) return false; // modloader not installed
HMODULE stdStreamModule = nullptr;
GetModuleHandleEx( 0, TEXT("std.stream.dll"), &stdStreamModule );
if ( stdStreamModule == nullptr ) return false; // std.data not loaded
HMODULE stdStreamModule;
if ( GetModuleHandleEx( 0, TEXT("std.stream.dll"), &stdStreamModule ) == 0 ) return false; // std.data not loaded
// ML is installed, so if it's an old version we need to fall back to a less safe implementation (no condition variables)
bCdStreamFallBackForOldML = true;