The PROCESS_HEAP_ENTRY structure contains information about a heap element. The HeapWalk function uses a PROCESS_HEAP_ENTRY structure to enumerate the elements of a heap.
typedef struct _PROCESS_HEAP_ENTRY { PVOID lpData; DWORD cbData; BYTE cbOverhead; BYTE iRegionIndex; WORD wFlags; union { struct { HANDLE hMem; DWORD dwReserved[ 3 ]; } Block; struct { DWORD dwCommittedSize; DWORD dwUnCommittedSize; LPVOID lpFirstBlock; LPVOID lpLastBlock; } Region; }; } PROCESS_HEAP_ENTRY;
To initiate a HeapWalk heap enumeration, set lpData to NULL.
If the PROCESS_HEAP_REGION bit flag is set in the wFlags member, lpData points to the first virtual address used by the region.
If the PROCESS_HEAP_UNCOMMITTED_RANGE bit flag is set in wFlags, lpData
points to the beginning of the range of uncommitted memory.
If the PROCESS_HEAP_REGION bit flag is set in wFlags, cbData specifies the total size, in bytes, of the address space that is reserved for this region.
If the PROCESS_HEAP_UNCOMMITTED_RANGE bit flag is set in wFlags, cbData
specifies the size, in bytes, of the range of uncommitted memory.
If the PROCESS_HEAP_REGION bit flag is set in wFlags, cbOverhead specifies the size, in bytes, of the heap control structures that describe the region.
If the PROCESS_HEAP_UNCOMMITTED_RANGE bit flag is set in wFlags, cbOverhead
specifies the size, in bytes, of the control structures that describe this
uncommitted range.
In the first heap entry returned for most heap regions, HeapWalk sets the PROCESS_HEAP_REGION flag in the wFlags member. When this flag is set, the members of the Region structure contain additional information about the region.
The HeapAlloc function sometimes uses the VirtualAlloc
function to allocate large blocks from a growable heap. The heap manager
treats such a large block allocation as a separate region with a unique region
index. HeapWalk does not set the PROCESS_HEAP_REGION flag in the heap
entry returned for a large block region, so the members of the Region
structure are not valid. You can use the VirtualQuery
function to get additional information about a large block region.
Value |
Meaning |
PROCESS_HEAP_REGION |
If this flag is set, the heap element is located at the beginning of a region of contiguous virtual memory in use by the heap. If this flag is set, the lpData member of the structure points to the first virtual address used by the region; the cbData member specifies the total size, in bytes, of the address space that is reserved for this region; and the cbOverhead member specifies the size, in bytes, of the heap control structures that describe the region. If this flag is set, the Region structure becomes valid. The dwCommittedSize, dwUnCommittedSize, lpFirstBlock, and lpLastBlock members of the structure contain additional information about the region. |
PROCESS_HEAP_UNCOMMITTED_RANGE |
If this flag is set, the heap element is located in a range of uncommitted memory within the heap region. If this flag is set, the lpData member points to the beginning of the range of uncommitted memory; the cbData member specifies the size, in bytes, of the range of uncommitted memory; and the cbOverhead member specifies the size, in bytes, of the control structures that describe this uncommitted range. |
PROCESS_HEAP_ENTRY_BUSY |
If this flag is set, the heap element is an allocated block. If both this flag and the PROCESS_HEAP_ENTRY_MOVEABLE flag are set, the Block structure becomes valid. The hMem member of the Block structure contains a handle to the allocated, moveable memory block. |
PROCESS_HEAP_ENTRY_MOVEABLE |
This flag is only valid if the PROCESS_HEAP_ENTRY_BUSY flag is set, indicating that the heap element is an allocated block. If this flag is valid and set, the block was allocated with the LMEM_MOVEABLE or GMEM_MOVEABLE flag, and the Block structure becomes valid. The hMem member of the Block structure contains a handle to the allocated, moveable memory block. |
PROCESS_HEAP_ENTRY_DDESHARE |
This flag is only valid if the PROCESS_HEAP_ENTRY_BUSY flag is set, indicating that the heap element is an allocated block. If this flag is valid and set, the block was allocated with the GMEM_DDESHARE flag. For a discussion of the GMEM_DDESHARE flag, see GlobalAlloc . |
The members of the Block structure are as follows:
Member |
Description |
hMem |
Contains a handle to the allocated, moveable memory block. |
dwReserved |
Reserved; not used. |
The members of the Region structure are as follows:
Member |
Description |
dwCommittedSize |
Specifies the number of bytes in the heap region that are currently committed as free memory blocks, busy memory blocks, or heap control structures. This is an optional field that is set to zero if the number of committed bytes is not available. |
dwUnCommittedSize |
Specifies the number of bytes in the heap region that are currently uncommitted. This is an optional field that is set to zero if the number of uncommitted bytes is not available. |
lpFirstBlock |
Pointer to the first valid memory block in this heap region. |
lpLastBlock |
Pointer to the first invalid memory block in thisheap region. |
GlobalAlloc, HeapAlloc, HeapWalk, VirtualAlloc, VirtualQuery
file: /Techref/os/win/api/win32/struc/src/str14_11.htm, 10KB, , updated: 2000/4/7 11:20, local time: 2024/12/12 00:41,
18.97.9.172:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/os/win/api/win32/struc/src/str14_11.htm"> PROCESS_HEAP_ENTRY</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.