DosAllocMem - Remarks

DosAllocMem can be used to reserve, or reserve and commit, linear address space for a private memory object.

The operating system allocates a range of private pages large enough to fulfill the specified allocation request from the private virtual-address space of the subject process. The base address of the object is returned in the ppb parameter.

The allocated memory object is rounded up to a multiple of 4KB in size.

The committed memory allocated by DosAllocMem can be swapped.

Any access protection can be applied to committed pages within a private memory object. Committed pages are initially allocated and backed by demand pages. The first attempt to read or write the page causes a page of zeros to be created.

If a failure occurs during the allocation, no pages are allocated, and an appropriate error code is returned.

With the Intel 80386 processor, execute and read access are equivalent. Also, write access implies both read and execute access.

The guard-page attribute is intended to provide automatic stack-growth and stack-limit checking. An application may also use it in other data structures.

Reserved pages that are not committed are given an access protection of "no access".


[Back: DosAllocMem - Parameters]
[Next: DosAllocMem - Related Functions]