Skip to content

Commit 53e8a37

Browse files
committed
Update HEAP_INFORMATION_CLASS, Fix RTL_USER_PROCESS_PARAMETERS32 types
1 parent a94fef7 commit 53e8a37

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

ProcessHacker/dbgcon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ NTSTATUS PhpDebugConsoleThreadStart(
15581558
debuggingInfo.StackTraceDepth = 32;
15591559
debuggingInfo.HeapLeakEnumerationRoutine = PhpLeakEnumerationRoutine;
15601560

1561-
if (!NT_SUCCESS(RtlSetHeapInformation(NULL, HeapDebuggingInformation, &debuggingInfo, sizeof(HEAP_DEBUGGING_INFORMATION))))
1561+
if (!NT_SUCCESS(RtlSetHeapInformation(NULL, HeapSetDebuggingInformation, &debuggingInfo, sizeof(HEAP_DEBUGGING_INFORMATION))))
15621562
{
15631563
wprintf(L"Unable to initialize heap debugging. Make sure that you are using Windows 7 or above.");
15641564
}

phnt/include/ntrtl.h

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3595,8 +3595,44 @@ RtlWalkHeap(
35953595
_Inout_ PRTL_HEAP_WALK_ENTRY Entry
35963596
);
35973597

3598-
// rev
3599-
#define HeapDebuggingInformation 0x80000002
3598+
// HEAP_INFORMATION_CLASS
3599+
#define HeapCompatibilityInformation 0x0 // q; s: ULONG
3600+
#define HeapEnableTerminationOnCorruption 0x1 // q; s: NULL
3601+
#define HeapExtendedInformation 0x2 // q; s: HEAP_EXTENDED_INFORMATION
3602+
#define HeapOptimizeResources 0x3 // q; s: HEAP_OPTIMIZE_RESOURCES_INFORMATION
3603+
#define HeapTaggingInformation 0x4
3604+
#define HeapStackDatabase 0x5
3605+
#define HeapDetailedFailureInformation 0x80000001
3606+
#define HeapSetDebuggingInformation 0x80000002 // q; s: HEAP_DEBUGGING_INFORMATION
3607+
3608+
typedef struct _PROCESS_HEAP_INFORMATION
3609+
{
3610+
ULONG_PTR ReserveSize;
3611+
ULONG_PTR CommitSize;
3612+
ULONG NumberOfHeaps;
3613+
ULONG_PTR FirstHeapInformationOffset;
3614+
} PROCESS_HEAP_INFORMATION, *PPROCESS_HEAP_INFORMATION;
3615+
3616+
typedef struct _HEAP_INFORMATION
3617+
{
3618+
ULONG_PTR Address;
3619+
ULONG Mode;
3620+
ULONG_PTR ReserveSize;
3621+
ULONG_PTR CommitSize;
3622+
ULONG_PTR FirstRegionInformationOffset;
3623+
ULONG_PTR NextHeapInformationOffset;
3624+
} HEAP_INFORMATION, *PHEAP_INFORMATION;
3625+
3626+
typedef struct _HEAP_EXTENDED_INFORMATION
3627+
{
3628+
HANDLE Process;
3629+
ULONG_PTR Heap;
3630+
ULONG Level;
3631+
PVOID CallbackRoutine;
3632+
PVOID CallbackContext;
3633+
PROCESS_HEAP_INFORMATION ProcessHeapInformation;
3634+
HEAP_INFORMATION HeapInformation;
3635+
} HEAP_EXTENDED_INFORMATION, *PHEAP_EXTENDED_INFORMATION;
36003636

36013637
// rev
36023638
typedef NTSTATUS (NTAPI *PRTL_HEAP_LEAK_ENUMERATION_ROUTINE)(

phnt/include/ntwow64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ typedef struct _RTL_USER_PROCESS_PARAMETERS32
219219
UNICODE_STRING32 RuntimeData;
220220
RTL_DRIVE_LETTER_CURDIR32 CurrentDirectories[RTL_MAX_DRIVE_LETTERS];
221221

222-
ULONG EnvironmentSize;
223-
ULONG EnvironmentVersion;
222+
WOW64_POINTER(ULONG_PTR) EnvironmentSize;
223+
WOW64_POINTER(ULONG_PTR) EnvironmentVersion;
224224
WOW64_POINTER(PVOID) PackageDependencyData;
225225
ULONG ProcessGroupId;
226226
ULONG LoaderThreads;

0 commit comments

Comments
 (0)