|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| No
| Win32s
| No
| Import Library
| -
| Header File
| winbase.h
| Unicode
| No
| Platform Notes
| None
|
|
|
PROCESS_HEAP_ENTRY
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;
Members
lpData
Points to the data portion of the heap element.
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.
cbData
Specifies the size, in bytes, of the data portion of the heap element.
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.
cbOverhead
Specifies the size, in bytes, of the data used by the system to maintain
information about the heap element. These overhead bytes are in addition to the cbData bytes of the data portion of the heap element.
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.
iRegionIndex
Identifies the heap region that contains the heap element. A heap consists of
one or more regions of virtual memory, each with a unique region index.
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.
wFlags
A set of bit flags that specify properties of the heap element. Some of these
flags affect the meaning of other members of this PROCESS_HEAP_ENTRY data structure. The following bit-flag constants are defined:
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 .
|
Block
This structure is valid only if both the PROCESS_HEAP_ENTRY_BUSY and
PROCESS_HEAP_ENTRY_MOVEABLE flags in wFlags are set.
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.
|
Region
This structure is valid only if the PROCESS_HEAP_REGION flag is set in the wFlags member.
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.
|
See Also
GlobalAlloc, HeapAlloc, HeapWalk, VirtualAlloc, VirtualQuery
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|