DosAllocMem - Parameters
ppb (PPVOID) - output
A
pointer to a variable that will receive the base address of the allocated
private memory object.
cb (ULONG) - input
flag (ULONG) - input
Allocate
attribute and desired access protection flags.
A set of flags describing the allocation attributes and desired access protection
for the private memory object. Possible values are shown in the lists below:
Allocation Attributes
PAG_COMMIT (0x00000010)
All pages in the private
memory object are initially committed.
OBJ_TILE
(0x00000040)
The private memory object must be
allocated in the first 512MB of virtual-address space, with 16-bit selectors
mapping the memory object.
The 16-bit selectors
are allocated to map the 32-bit object at 64KB boundaries. The figure below
shows how the 16-bit alias selectors map the 32-bit object.
32-bit 32-bit 16-bit alias
Offset Object Selectors
BaseAddress+000KB┌──────────────┐ ───── Sel
│ │
BaseAddress+064KB├──────────────┤ ───── Sel+HugeInc
│ │
BaseAddress+128KB├──────────────┤ ───── Sel+HugeInc*2
│ │
BaseAddress+192KB├──────────────┤ ───── Sel+HugeInc*3
│ │
HugeInc is the huge increment used for DosAllocHuge.
Desired Access Protection
PAG_EXECUTE (0x00000004)
Execute access to the
committed pages in the private memory object
PAG_READ
(0x00000001)
PAG_WRITE
(0x00000002)
PAG_GUARD
(0x00000008)
Access to the committed pages in the
private memory object causes a "guard page entered" condition to be raised
in the subject process.
At least one of the bits
PAG_READ, PAG_WRITE, or PAG_EXECUTE must be set.
ulrc (APIRET) - returns
[Back: DosAllocMem Return Value - ulrc]
[Next: DosAllocMem - Remarks]