VirtualAlloc

VirtualAlloc allocates memory in the eRTOS virtual address space. Memory allocated by this function is uninitialized.

Syntax

Copy
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:

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:

VirtualFree