diff --git a/src/osal.c b/src/osal.c index 4dc6861c..d19c3d36 100644 --- a/src/osal.c +++ b/src/osal.c @@ -1945,6 +1945,9 @@ __cold MDBX_INTERNAL_FUNC void mdbx_osal_jitter(bool tiny) { #if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \ defined(__x86_64__) const unsigned salt = 277u * (unsigned)__rdtsc(); +#elif (defined(_WIN32) || defined(_WIN64)) && MDBX_WITHOUT_MSVC_CRT + static ULONG state; + const unsigned salt = (unsigned)RtlRandomEx(&state); #else const unsigned salt = rand(); #endif diff --git a/src/osal.h b/src/osal.h index 31a5d1a7..6a7992bb 100644 --- a/src/osal.h +++ b/src/osal.h @@ -991,6 +991,8 @@ typedef LSTATUS(WINAPI *MDBX_RegGetValueA)(HKEY hkey, LPCSTR lpSubKey, LPDWORD pcbData); MDBX_INTERNAL_VAR MDBX_RegGetValueA mdbx_RegGetValueA; +NTSYSAPI ULONG RtlRandomEx(PULONG Seed); + #endif /* Windows */ #endif /* !__cplusplus */