Process Hacker
heapstruct.h
Go to the documentation of this file.
1 #ifndef PH_HEAPSTRUCT_H
2 #define PH_HEAPSTRUCT_H
3 
4 // Not the actual structure, but has the same size.
5 typedef struct _HEAP_ENTRY
6 {
7  PVOID Data1;
8  PVOID Data2;
10 
11 #define HEAP_SEGMENT_SIGNATURE 0xffeeffee
12 
13 // First few fields of HEAP_SEGMENT, VISTA and above
14 typedef struct _HEAP_SEGMENT
15 {
18  ULONG SegmentFlags;
19  LIST_ENTRY SegmentListEntry;
20  struct _HEAP *Heap;
21 
22  // ...
24 
25 // First few fields of HEAP_SEGMENT, WS03 and below
26 typedef struct _HEAP_SEGMENT_OLD
27 {
29  ULONG Signature;
30  ULONG Flags;
31  struct _HEAP *Heap;
32 
33  // ...
35 
36 // 32-bit versions
37 
38 typedef struct _HEAP_ENTRY32
39 {
40  WOW64_POINTER(PVOID) Data1;
41  WOW64_POINTER(PVOID) Data2;
43 
44 typedef struct _HEAP_SEGMENT32
45 {
48  ULONG SegmentFlags;
49  LIST_ENTRY32 SegmentListEntry;
50  WOW64_POINTER(struct _HEAP *) Heap;
51 
52  // ...
54 
55 typedef struct _HEAP_SEGMENT_OLD32
56 {
58  ULONG Signature;
59  ULONG Flags;
60  WOW64_POINTER(struct _HEAP *) Heap;
61 
62  // ...
64 
65 #define HEAP_SEGMENT_MAX_SIZE \
66  (max(sizeof(HEAP_SEGMENT), max(sizeof(HEAP_SEGMENT_OLD), \
67  max(sizeof(HEAP_SEGMENT32), sizeof(HEAP_SEGMENT_OLD32)))))
68 
69 #endif