#define _CRT_SECURE_NO_WARNINGS #include #include #include #include "debug.h" #include "mytypes.h" int main( int argc, char **argv ) { U64 size = 4096, base = 4294967296; char *p; while( 1 ) { char *p = VirtualAllocEx( GetCurrentProcess(), (VOID*)base, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ); DIEIF( p == NULL ); printf( "4k allocated at:%16p (%30I64d)\n", p, 0+p ); _getch(); base *= 2; } exit( 0 ); } #### C:\test>vmem3 4k allocated at:0000000100000000 ( 4294967296) 4k allocated at:0000000200000000 ( 8589934592) 4k allocated at:0000000400000000 ( 17179869184) 4k allocated at:0000000800000000 ( 34359738368) 4k allocated at:0000001000000000 ( 68719476736) 4k allocated at:0000002000000000 ( 137438953472) 4k allocated at:0000004000000000 ( 274877906944) 4k allocated at:0000008000000000 ( 549755813888) 4k allocated at:0000010000000000 ( 1099511627776) 4k allocated at:0000020000000000 ( 2199023255552) 4k allocated at:0000040000000000 ( 4398046511104) [ 1916] vmem3.c(18):p == NULL failed with error 87 (The parameter is incorrect)