[This is preliminary documentation and subject to change.]
The VirtualAllocVlm function commits a region of pages in the virtual 64-bit address space of the indicated process.
PVOID64 VirtualAllocVlm(
HANDLE hProcess, // process within which to allocate memory
PVOID64 lpAddress, // address of region to reserve or commit
DWORDLONG ullSize, // size of region
DWORD flAllocationType,
// type of allocation
DWORD flProtect // type of access protection
);
Value | Meaning |
---|---|
MEM_COMMIT | Allocates for the specified region of pages physical storage in memory or in the paging file on disk. |
An attempt to commit an already committed page does not cause VirtualAllocVlm to fail. Thus, a range of committed or decommitted pages can be committed without causing a failure. | |
MEM_RESERVE | Reserves a range of the process's virtual address space without allocating any physical storage. The reserved range cannot be used by any other allocation operations (for example, the malloc function, the LocalAlloc function, and so on) until it is released. |
Value | Meaning |
---|---|
PAGE_READONLY | Enables read access to the committed region of pages. An attempt to write to the committed region results in an access violation. If the operating system differentiates between read-only access and execute access, an attempt to execute code in the committed region results in an access violation. |
PAGE_READWRITE | Enables both read and write access to the committed region of pages. |
If the function succeeds, the return value is the base address of the allocated region of pages.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
The VirtualAllocVlm function is used to allocate and specify an initial protection value for memory regions that can be addressed through 64-bit pointers.
Memory allocated by VirtualAllocVlm must be physically present in the system. This memory is considered locked down and unavailable to the rest of the virtual memory management system of Windows NT. Programmers using VirtualAllocVlm should understand that this function is allocating dedicated resources.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Memory Management Overview, Memory Management Functions, Very Large Memory (VLM), GlobalAlloc, HeapAlloc, LocalAlloc, OpenProcess, VirtualAlloc, VirtualFreeVlm, VirtualLock, VirtualProtectVlm, VirtualQueryVlm