https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dd83bcd6ad67e320c04a3…
commit dd83bcd6ad67e320c04a393492cbbe342d9601b9
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Feb 1 21:34:03 2020 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Jun 14 09:10:27 2020 +0200
[RTL] Create a define for the common members of HEAP and HEAP_SEGMENT. CORE-14588
The code relies on these members matching up, so it's confusing for them
to be duplicated.
---
sdk/lib/rtl/heap.h | 46 ++++++++++++++++++----------------------------
1 file changed, 18 insertions(+), 28 deletions(-)
diff --git a/sdk/lib/rtl/heap.h b/sdk/lib/rtl/heap.h
index c4c46a45b45..8fb9bc7ae0d 100644
--- a/sdk/lib/rtl/heap.h
+++ b/sdk/lib/rtl/heap.h
@@ -203,22 +203,25 @@ typedef struct _HEAP_LIST_LOOKUP
PLIST_ENTRY *ListHints;
} HEAP_LIST_LOOKUP, *PHEAP_LIST_LOOKUP;
+#define HEAP_SEGMENT_MEMBERS \
+ HEAP_ENTRY Entry; \
+ ULONG SegmentSignature; \
+ ULONG SegmentFlags; \
+ LIST_ENTRY SegmentListEntry; \
+ struct _HEAP *Heap; \
+ PVOID BaseAddress; \
+ ULONG NumberOfPages; \
+ PHEAP_ENTRY FirstEntry; \
+ PHEAP_ENTRY LastValidEntry; \
+ ULONG NumberOfUnCommittedPages; \
+ ULONG NumberOfUnCommittedRanges; \
+ USHORT SegmentAllocatorBackTraceIndex; \
+ USHORT Reserved; \
+ LIST_ENTRY UCRSegmentList
+
typedef struct _HEAP
{
- HEAP_ENTRY Entry;
- ULONG SegmentSignature;
- ULONG SegmentFlags;
- LIST_ENTRY SegmentListEntry;
- struct _HEAP *Heap;
- PVOID BaseAddress;
- ULONG NumberOfPages;
- PHEAP_ENTRY FirstEntry;
- PHEAP_ENTRY LastValidEntry;
- ULONG NumberOfUnCommittedPages;
- ULONG NumberOfUnCommittedRanges;
- USHORT SegmentAllocatorBackTraceIndex;
- USHORT Reserved;
- LIST_ENTRY UCRSegmentList;
+ HEAP_SEGMENT_MEMBERS;
ULONG Flags;
ULONG ForceFlags;
@@ -271,20 +274,7 @@ typedef struct _HEAP
typedef struct _HEAP_SEGMENT
{
- HEAP_ENTRY Entry;
- ULONG SegmentSignature;
- ULONG SegmentFlags;
- LIST_ENTRY SegmentListEntry;
- PHEAP Heap;
- PVOID BaseAddress;
- ULONG NumberOfPages;
- PHEAP_ENTRY FirstEntry;
- PHEAP_ENTRY LastValidEntry;
- ULONG NumberOfUnCommittedPages;
- ULONG NumberOfUnCommittedRanges;
- USHORT SegmentAllocatorBackTraceIndex;
- USHORT Reserved;
- LIST_ENTRY UCRSegmentList;
+ HEAP_SEGMENT_MEMBERS;
} HEAP_SEGMENT, *PHEAP_SEGMENT;
typedef struct _HEAP_UCR_DESCRIPTOR