Reactos
1#include <stdio.h>
2#include <string.h>
3#include <windows.h>
4
5#define SIZE (65*1024*1024)
6
7ULONG x[SIZE / 4096];
8
9int main()
10{
11 int i;
12 PUCHAR BaseAddress;
13
14 BaseAddress = VirtualAlloc(NULL,
15 SIZE,
16 MEM_COMMIT,
17 PAGE_READONLY);
18 if (BaseAddress == NULL)
19 {
20 printf("Failed to allocate virtual memory");
21 return(1);
22 }
23 printf("BaseAddress %p\n", BaseAddress);
24 for (i = 0; i < (SIZE / 4096); i++)
25 {
26 printf("%.8x ", i*4096);
27 x[i] = BaseAddress[i*4096];
28 }
29
30 return(0);
31}