VDDAllocMem

BOOL VDDAllocMem(hVdd, Address, Size)
IN HANDLE hVdd;
IN PVOID Address;
IN DWORD Size;

VDDAllocMem allocates memory at a given virtual address.

Parameters

hVdd

Identifies the VDD.

Address

Specifies the address between 640K and 1MB where memory will be allocated.

Size

Specifies the number of bytes of memory to allocate.

Return Value

VDDAllocMem returns TRUE if successful. If the function fails then FALSE is returned and an error is logged.

The extended error codes are:

Value Meaning
ERROR_OUTOFMEMORY Indicates insufficient memory error.
ERROR_INVALID_ADDRESS Identifies invalid address error.

Comments

VDDs must use this function instead of VirtualAlloc (see the Win32 SDK) to allocate memory.

Address is page-aligned downwards, and Size is stretched upward to be page-aligned.

Address is relative to DOS 0:0. GetVDMPointer should not be called on this address before calling VDDAllocMem.

This address is the same as that provided by the hook handler for memory-mapped I/O.

See Also

GetVDMPointer