HeapMemory.inc

This file defines constants, structures, and macros for heap memory management functions of PwnOS.

See Also

Authors

  • Neil G.  Dickson
Summary
HeapMemory.incThis file defines constants, structures, and macros for heap memory management functions of PwnOS.
HEAP_MEMORY_HEADERThis structure defines the heap memory header.
HEAP_MEMORY_NODEThis structure defines a heap memory range node.
Enumerations
Heap Memory Node FlagsThese are constants for the Flags member of HEAP_MEMORY_NODE.

HEAP_MEMORY_HEADER

This structure defines the heap memory header.

Members

AccessLockLOCKSTRUCT to lock access to the heap so that only one thread can allocate at a time
AddressStart address of heap memory
nBytesTotal # of bytes of heap memory, including tree nodes
pFreeRootAddress of Free Tree root node (HEAP_MEMORY_NODE)
pAddrRootAddress of Address Tree root node (HEAP_MEMORY_NODE)
pNewNodeAddress at which to add new nodes
Padding(padding to 16-byte alignment)

HEAP_MEMORY_NODE

This structure defines a heap memory range node.

Members

AddressAddress of heap memory range; Always dword-aligned
nBytesTotal # of bytes of heap memory range; Always multiple of 4
FlagsHEAP_MEMORY_FLAG_ALLOCATION set if range is an allocation (clear if range is a free range)
Padding(padding to 16-byte alignment)
pFreeParentAddress of parent node in Free Tree
pFreeLeftAddress of left child node in Free Tree
pFreeRightAddress of right child node in Free Tree
FreeHeightHeight of this node’s subtree in Free Tree
pAddrParentAddress of parent node in Address Tree
pAddrLeftAddress of left child node in Address Tree
pAddrRightAddress of right child node in Address Tree
AddrHeightHeight of this node’s subtree in Address Tree
Summary
Enumerations
Heap Memory Node FlagsThese are constants for the Flags member of HEAP_MEMORY_NODE.

Enumerations

Heap Memory Node Flags

These are constants for the Flags member of HEAP_MEMORY_NODE.

Start Value

1 Increment: shl

Members

HEAP_MEMORY_FLAG_ALLOCATIONindicates that the memory range is allocated if set (and free range if clear)
This structure defines a heap memory range node.
This file defines heap memory management functions of PwnOS.
This structure is the centre of synchronization data in PwnOS, defining the state of an access lock.