Reserves and/or commits a region of memory within the virtual address space of the target process.
HRESULT AllocateVirtualMemory( UINT64 address, DWORD size, DWORD allocationType, DWORD pageProtection, UINT64 *pAllocatedAddress );
[in] The address within the target process where the memory should be committed or reserved. This value is typically zero, in which case the system chooses an address.
[in] The size of the region of memory to allocate, in bytes. The system will automatically round up to the next page boundary.
[in] Indicates the type of allocation to perform. This is typically MEM_COMMIT | MEM_RESERVE (0x3000) which reserves and commits an allocation in one step.
[in] The memory protection for the region of pages to be allocated. If the pages are being committed, you can specify any one of the memory protection constants (for example, PAGE_READWRITE, PAGE_EXECUTE).
[out] Base address of the allocated region of pages.
The function initializes the memory it allocates to zero, unless MEM_RESET is used. For additional information, see the VirtualAlloc Win32 API.