From 36edfbc70ae4610d06b9fce245f35d92e6be92a5 Mon Sep 17 00:00:00 2001 From: Daan Leijen Date: Thu, 9 Dec 2021 16:18:17 -0800 Subject: [PATCH] use rtlgenrandom by default on windows --- src/random.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/random.c b/src/random.c index 05c5c99c..1220401a 100644 --- a/src/random.c +++ b/src/random.c @@ -167,8 +167,9 @@ If we cannot get good randomness, we fall back to weak randomness based on a tim #if defined(_WIN32) -#if !defined(MI_USE_RTLGENRANDOM) -// We prefer BCryptGenRandom over RtlGenRandom +#if defined(MI_USE_BCRYPTGENRANDOM) +// We would like to use BCryptGenRandom instead of RtlGenRandom but it can lead to a deadlock +// under the VS debugger when using dynamic overriding. #pragma comment (lib,"bcrypt.lib") #include static bool os_random_buf(void* buf, size_t buf_len) {