From 11c78f701dabaa098f80dfea2e259861b02c80e0 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Dec 2017 15:16:04 +0100 Subject: [PATCH] [NTOS:MM] Implement x64 version of MI_MAKE_SUBSECTION_PTE --- ntoskrnl/include/internal/amd64/mm.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ntoskrnl/include/internal/amd64/mm.h b/ntoskrnl/include/internal/amd64/mm.h index 0f5f3b7c03c..2248ab490e4 100644 --- a/ntoskrnl/include/internal/amd64/mm.h +++ b/ntoskrnl/include/internal/amd64/mm.h @@ -242,10 +242,18 @@ MiPxeToAddress(PMMPTE PointerPxe) FORCEINLINE VOID -MI_MAKE_SUBSECTION_PTE(IN PMMPTE NewPte, - IN PVOID Segment) +MI_MAKE_SUBSECTION_PTE( + _Out_ PMMPTE NewPte, + _In_ PVOID Segment) { - ASSERT(FALSE); + ULONG_PTR Offset; + + /* Mark this as a prototype */ + NewPte->u.Long = 0; + NewPte->u.Subsect.Prototype = 1; + + /* Store the lower 48 bits of the Segment address */ + NewPte->u.Subsect.SubsectionAddress = ((ULONG_PTR)Segment & 0x0000FFFFFFFFFFFF); } FORCEINLINE