VirtualAlloc
VirtualAlloc allocates memory in the wRTOS virtual address space. Memory allocated by this function is uninitialized.
Syntax
LPVOID WINAPI VirtualAlloc(
[in, optional] LPVOID lpAddress,
[in] SIZE_T dwSize,
[in] DWORD flAllocationType,
[in] DWORD flProtect
);
Parameters
[in, optional] 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.
[in] dwSize
The size of the region, in bytes. If lpAddress is non-NULL, this is ignored. This is rounded up to the next page boundary.
[in] 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.
[in] 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 |
|---|---|---|
|
wRTOS 1.0 SDK |
windows.h |
wRTOS_rtss.lib |
See Also: