ReactOS
0.4.15-dev-7842-g558ab78
vmtest.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <windows.h>
3
4
int
main
()
5
{
6
PBYTE
Base
;
7
PVOID
Ret;
8
9
Base
=
VirtualAlloc
(
NULL
,
10
1048576,
11
MEM_RESERVE
,
12
PAGE_READWRITE
);
13
if
(
Base
==
NULL
)
14
{
15
printf
(
"VirtualAlloc failed 1\n"
);
16
}
17
18
Ret =
VirtualAlloc
(
Base
+ 4096,
19
4096,
20
MEM_COMMIT
,
21
PAGE_READWRITE
);
22
if
(Ret ==
NULL
)
23
{
24
printf
(
"VirtualAlloc failed 2\n"
);
25
}
26
27
Ret =
VirtualAlloc
(
Base
+ 12288,
28
4096,
29
MEM_COMMIT
,
30
PAGE_READWRITE
);
31
if
(Ret ==
NULL
)
32
{
33
printf
(
"VirtualAlloc failed 3\n"
);
34
}
35
36
Ret =
VirtualAlloc
(
Base
+ 20480,
37
4096,
38
MEM_COMMIT
,
39
PAGE_READWRITE
);
40
if
(Ret ==
NULL
)
41
{
42
printf
(
"VirtualAlloc failed 4\n"
);
43
}
44
45
Ret =
VirtualAlloc
(
Base
+ 4096,
46
28672,
47
MEM_RESERVE
,
48
PAGE_READWRITE
);
49
if
(Ret ==
NULL
)
50
{
51
printf
(
"VirtualAlloc failed 5\n"
);
52
}
53
return
0;
54
}
55
NULL
#define NULL
Definition:
types.h:112
printf
#define printf
Definition:
freeldr.h:93
void
Definition:
nsiface.idl:2307
Base
_In_opt_ ULONG Base
Definition:
rtlfuncs.h:2439
PAGE_READWRITE
#define PAGE_READWRITE
Definition:
nt_native.h:1304
MEM_RESERVE
#define MEM_RESERVE
Definition:
nt_native.h:1314
MEM_COMMIT
#define MEM_COMMIT
Definition:
nt_native.h:1313
PBYTE
BYTE * PBYTE
Definition:
pedump.c:66
main
int main()
Definition:
vmtest.c:4
VirtualAlloc
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
Definition:
virtmem.c:65
modules
rostests
tests
vmtest
vmtest.c
Generated on Thu Mar 28 2024 06:08:24 for ReactOS by
1.9.6