mirror of
https://github.com/reactos/reactos.git
synced 2024-07-14 00:25:05 +00:00
[ADVAPI32]
- Hackfix RtlGenRandom to be slightly less dependent on the current time, while staying very un-random. - Should fix services problems (no joke) due to non-unique RPC UUIDs See issue #6542 for more details. svn path=/trunk/; revision=54069
This commit is contained in:
parent
d38c1a938a
commit
24e4f7e73d
|
@ -576,6 +576,8 @@ SystemFunction036(PVOID pbBuffer, ULONG dwLen)
|
|||
DWORD dwSeed;
|
||||
PBYTE pBuffer;
|
||||
ULONG uPseudoRandom;
|
||||
LARGE_INTEGER time;
|
||||
static ULONG uCounter = 17;
|
||||
|
||||
if(!pbBuffer || !dwLen)
|
||||
{
|
||||
|
@ -583,8 +585,9 @@ SystemFunction036(PVOID pbBuffer, ULONG dwLen)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* Get the first seed from the tick count */
|
||||
dwSeed = GetTickCount();
|
||||
/* Get the first seed from the performance counter */
|
||||
QueryPerformanceCounter(&time);
|
||||
dwSeed = time.LowPart ^ time.HighPart ^ RtlUlongByteSwap(uCounter++);
|
||||
|
||||
/* We will access the buffer bytewise */
|
||||
pBuffer = (PBYTE)pbBuffer;
|
||||
|
|
Loading…
Reference in a new issue