Expand Minimize

RtlRandom routine

The RtlRandom routine returns a random number that was generated from a given seed value.

Syntax


ULONG RtlRandom(
  _Inout_  PULONG Seed
);

Parameters

Seed [in, out]

Unsigned long value from which to generate a random number.

Return value

RtlRandom returns a random number in the range [0..MAXLONG-1].

Remarks

RtlRandom returns values that are uniformly distributed over the range from zero to the maximum possible LONG value less 1 if it is called repeatedly with the same Seed.

The RtlRandomEx function is an improved version of the RtlRandom function that is twice as fast and produces better random numbers.

Requirements

Version

Available in Microsoft Windows 2000 and later.

Header

Ntifs.h (include Ntifs.h or Fltkernel.h)

Library

Ntoskrnl.lib

IRQL

< DISPATCH_LEVEL

See also

RtlRandomEx

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft