Author: tfaber Date: Mon Jun 23 15:21:13 2014 New Revision: 63633
URL: http://svn.reactos.org/svn/reactos?rev=63633&view=rev Log: [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.
Modified: trunk/reactos/dll/win32/advapi32/misc/sysfunc.c
Modified: trunk/reactos/dll/win32/advapi32/misc/sysfunc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/sys... ============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/sysfunc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/sysfunc.c [iso-8859-1] Mon Jun 23 15:21:13 2014 @@ -607,9 +607,9 @@ 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;