VirtualAlloc
VirtualAlloc allocates memory in the eRTOS virtual address space. Memory allocated by this function is uninitialized.
Syntax
LPVOID WINAPI VirtualAlloc(
LPVOID lpAddress,
SIZE_T dwSize,
DWORD flAllocationType,
DWORD flProtect
);
Parameters
lpAddress
The starting address of the region to allocate. This must be NULL or an address obtained from a previous call to this function. If this is non-NULL, dwSize is ignored.
dwSize
The size of the region, in bytes. This is ignored if lpAddress is non-NULL. This is rounded up to the next page boundary.
flAllocationType
The type of memory allocation. This parameter must contain one of the following values:
- 0x0 — Allocates memory normally.
- MEM_RESERVE — When this allocation type is given, if dwSize is greater than 1,048,576 bytes (1 MB), it is set to 1,048,576 bytes.
flProtect
This parameter is ignored.
Return Value
If the function succeeds, it returns the base address of the allocated memory. If the function fails, it returns NULL.
Requirements
Minimum supported version | Header | Library |
---|---|---|
eRTOS 1.0 SDK |
windows.h | rtkrnl.lib |
See Also: