From f4650438d7288fc25c0666e7409c0d5402370780 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Wed, 23 Nov 2022 00:22:57 +0100 Subject: [PATCH] Small code refactoring. --- hashset/src/main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hashset/src/main.c b/hashset/src/main.c index 7ae47bd..f1c829f 100644 --- a/hashset/src/main.c +++ b/hashset/src/main.c @@ -29,11 +29,9 @@ #define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0U])) #ifdef _WIN32 -unsigned char __stdcall SystemFunction036(void *buffer, unsigned long length); -static int getentropy(void* const buffer, const size_t length) -{ - return SystemFunction036(buffer, (unsigned long)length) ? 0 : (-1); -} +#define RtlGenRandom SystemFunction036 +#define getentropy(X,Y) (RtlGenRandom((X),(uint32_t)(Y)) ? 0 : (-1)) +unsigned char __stdcall RtlGenRandom(void *buffer, uint32_t length); #endif static INLINE uint64_t random_uint64(void)