diff --git a/Source/RNG/AuRNGEntropy.cpp b/Source/RNG/AuRNGEntropy.cpp index c7178828..3bd912d4 100644 --- a/Source/RNG/AuRNGEntropy.cpp +++ b/Source/RNG/AuRNGEntropy.cpp @@ -114,19 +114,19 @@ namespace Aurora::RNG static AuUInt32 RngWin32(AuUInt8 *pBuf, AuUInt32 uLen) { + if (pRtlGenRandom) + { + if (pRtlGenRandom(pBuf, uLen)) + { + return uLen; + } + } + if (pBCryptGenRandom) { if (AuSwInfo::IsWindows10OrGreater() || AuBuild::kCurrentPlatform != AuBuild::EPlatform::ePlatformWin32) { - if (pRtlGenRandom) - { - if (pRtlGenRandom(pBuf, uLen)) - { - return uLen; - } - } - if (pBCryptGenRandom(BCRYPT_RNG_ALG_HANDLE, reinterpret_cast(pBuf), uLen, 0) == 0) { return uLen; @@ -139,14 +139,6 @@ namespace Aurora::RNG } } - if (pRtlGenRandom) - { - if (pRtlGenRandom(pBuf, uLen)) - { - return uLen; - } - } - #if defined(AURORA_RNG_HAS_OLD_WINCRYPT) if (gCryptoProv) {