[NTOS:MM] Implement x64 version of MI_MAKE_SUBSECTION_PTE
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 19 Dec 2017 14:16:04 +0000 (15:16 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 20 Dec 2017 05:56:09 +0000 (06:56 +0100)
ntoskrnl/include/internal/amd64/mm.h

index 0f5f3b7..2248ab4 100644 (file)
@@ -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