Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions MemInfo/MemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ NTSTATUS PfiQueryMemoryRanges() {
ULONG ResultLength = 0;

//
// Memory Ranges API was added in RTM, this is Version 1
// Memory Ranges API was added in RTM, this is Version 1. Since Windows 10 it is Version 2.
//
MemoryRangeInfo.Version = 1;
MemoryRangeInfo.Version = 2;
MemoryRangeInfo.flags = 0;

//
// Build the Superfetch Information Buffer
Expand All @@ -84,7 +85,8 @@ NTSTATUS PfiQueryMemoryRanges() {
// Reallocate memory
//
MemoryRanges = static_cast<PPF_MEMORY_RANGE_INFO>(::HeapAlloc(GetProcessHeap(), 0, ResultLength));
MemoryRanges->Version = 1;
MemoryRanges->Version = 2;
MemoryRanges->flags = 0;

//
// Rebuild the buffer
Expand Down
10 changes: 10 additions & 0 deletions MemInfo/MemInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,21 @@ typedef struct _PF_PHYSICAL_MEMORY_RANGE {
ULONG_PTR PageCount;
} PF_PHYSICAL_MEMORY_RANGE, *PPF_PHYSICAL_MEMORY_RANGE;

/*
typedef struct _PF_MEMORY_RANGE_INFO {
ULONG Version;
ULONG RangeCount;
PF_PHYSICAL_MEMORY_RANGE Ranges[ANYSIZE_ARRAY];
} PF_MEMORY_RANGE_INFO, *PPF_MEMORY_RANGE_INFO;
*/
//Information from https://blog.midi12.re/systemsuperfetchinformation/
typedef struct _PF_MEMORY_RANGE_INFO {
ULONG Version;
ULONG flags; // added between 10_1709_16299_248 and 10_1803_17134_81
ULONG RangeCount;
PF_PHYSICAL_MEMORY_RANGE Ranges[ANYSIZE_ARRAY];
} PF_MEMORY_RANGE_INFO, * PPF_MEMORY_RANGE_INFO;


//
// Sub-Information Types for PFN Identity
Expand Down