X86 application. For the next code
void *a = VirtualAlloc(0, 0x14000000, MEM_RESERVE, PAGE_READWRITE); void *b = VirtualAlloc(0, 0x8000000, MEM_RESERVE, PAGE_READWRITE); void *c = VirtualAlloc(0, 0x18000000, MEM_RESERVE, PAGE_READWRITE); "sometimes" c equals 0 GetLastError() == 8 (ERROR_NOT_ENOUGH_MEMORY), therefore, the application cannot continue its work and terminates. It is treated by rebooting the system.
If you do not restart and swap the first and third lines, everything will work fine. Re-exchange necessarily leads to the same problem. What are the reasons why the code can not work?