ReactOS
0.4.16-dev-1078-g21d3e29
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
rand_s.cpp
Go to the documentation of this file.
1
//
2
// rand_s.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// The implementation of the rand_s() function, which generates random numbers.
7
//
8
#include <
corecrt_internal.h
>
9
#include <stdlib.h>
10
11
12
13
extern
"C"
errno_t
__cdecl
rand_s
(
unsigned
int
*
const
result
)
14
{
15
_VALIDATE_RETURN_ERRCODE
(
result
!=
nullptr
,
EINVAL
);
16
*
result
= 0;
17
18
if
(!
__acrt_RtlGenRandom
(
result
,
static_cast<
ULONG
>
(
sizeof
(*
result
))))
19
{
20
errno
=
ENOMEM
;
21
return
errno
;
22
}
23
24
return
0;
25
}
EINVAL
#define EINVAL
Definition:
acclib.h:90
ENOMEM
#define ENOMEM
Definition:
acclib.h:84
__cdecl
#define __cdecl
Definition:
accygwin.h:79
corecrt_internal.h
result
GLuint64EXT * result
Definition:
glext.h:11304
_VALIDATE_RETURN_ERRCODE
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)
Definition:
internal_shared.h:143
rand_s
errno_t __cdecl rand_s(unsigned int *const result)
Definition:
rand_s.cpp:13
errno
#define errno
Definition:
errno.h:18
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
errno_t
int errno_t
Definition:
corecrt.h:615
__acrt_RtlGenRandom
BOOLEAN WINAPI __acrt_RtlGenRandom(PVOID const buffer, ULONG const buffer_count)
Definition:
winapi_thunks.cpp:775
sdk
lib
ucrt
stdlib
rand_s.cpp
Generated on Sun May 4 2025 06:06:59 for ReactOS by
1.9.6