From 9e0c44c18da3f7e308a6953d5788d440e38c7b3b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Mon, 23 Jun 2014 15:21:13 +0000 Subject: [PATCH] [ADVAPI32] - Do not use the upper byte of RtlRandom's result in RtlGenRandom, since the function only generates 31 bits. Should fix UuidCreate test in rpcrt4:rpc. svn path=/trunk/; revision=63633 --- reactos/dll/win32/advapi32/misc/sysfunc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/advapi32/misc/sysfunc.c b/reactos/dll/win32/advapi32/misc/sysfunc.c index b8fc700b076..12713ddc945 100644 --- a/reactos/dll/win32/advapi32/misc/sysfunc.c +++ b/reactos/dll/win32/advapi32/misc/sysfunc.c @@ -607,9 +607,9 @@ SystemFunction036(PVOID pbBuffer, ULONG dwLen) do { /* Get each byte from the pseudo random number and store it in the buffer */ - *pBuffer = (BYTE)(uPseudoRandom >> 8 * (dwLen % 4) & 0xFF); + *pBuffer = (BYTE)(uPseudoRandom >> 8 * (dwLen % 3) & 0xFF); ++pBuffer; - } while(--dwLen % 4); + } while(--dwLen % 3); } while(dwLen); return TRUE;