Implement RtlRandomEx by copy RtlRandom code.

ms have two different implement, One random is faster that other, (in some doc I read (maybe from osr) some year ago),  the RtlRandomEx  is not document in the free ddk/sdk, but it is include in ddk/ifs kit, according the doc. 

svn path=/trunk/; revision=23799
This commit is contained in:
Magnus Olsen 2006-08-30 10:13:01 +00:00
parent 5a487c19e7
commit 0b5c566337

View file

@ -83,16 +83,26 @@ RtlRandom (IN OUT PULONG Seed)
}
/*
* @unimplemented
* @implemented
*/
ULONG
NTAPI
RtlRandomEx(
PULONG Seed
RtlRandomEx( IN OUT PULONG Seed
)
{
UNIMPLEMENTED;
return 0;
ULONG Rand;
int Pos;
ULONG Result;
PAGED_CODE_RTL();
Rand = (*Seed * 0x7fffffed + 0x7fffffc3) % 0x7fffffff;
*Seed = (Rand * 0x7fffffed + 0x7fffffc3) % 0x7fffffff;
Pos = *Seed & 0x7f;
Result = SavedValue[Pos];
SavedValue[Pos] = Rand;
return Result;
}