RtlRandom - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

_Ret_range_(<=, MAXLONG)
NTSYSAPI
ULONG
NTAPI
RtlRandom(
    _Inout_ PULONG Seed
    );

#endif

View code on GitHub
/*
 * RTL forward symbol typedefs
 *
 * This file is part of System Informer.
 */
#ifndef _NTRTL_FWD_H
// Note: ntdll symbols and exports define these forwarders:
// begin_forwarders
#ifndef PHNT_INLINE_NAME_FORWARDERS

#define RtlRandom RtlRandomEx

#endif
// end_forwarders
#endif

View code on GitHub
// ntifs.h

NTSYSAPI ULONG RtlRandom(
  [in, out] PULONG Seed
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntifs-rtlrandom)

RtlRandom function

Description

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

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.

See also

RtlRandomEx