https://git.reactos.org/?p=reactos.git;a=commitdiff;h=539c31658985005bf22a9fb03b967d7bbae1417d

commit 539c31658985005bf22a9fb03b967d7bbae1417d
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Fri Apr 14 10:34:21 2023 +0300
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Sat Jul 29 14:00:44 2023 +0300

    [NTOS:Mm] Fix some 64 bit issues
---
 ntoskrnl/mm/i386/page.c | 2 +-
 ntoskrnl/mm/pagefile.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c
index 38cd5066256..e0f7a304c8b 100644
--- a/ntoskrnl/mm/i386/page.c
+++ b/ntoskrnl/mm/i386/page.c
@@ -598,7 +598,7 @@ MmCreatePageFileMapping(PEPROCESS Process,
     /* And we don't support creating for other process */
     ASSERT(Process == PsGetCurrentProcess());
 
-    if (SwapEntry & (1 << 31))
+    if (SwapEntry & (1 << (sizeof(SWAPENTRY) - 1)))
     {
         KeBugCheck(MEMORY_MANAGEMENT);
     }
diff --git a/ntoskrnl/mm/pagefile.c b/ntoskrnl/mm/pagefile.c
index a57c4de0304..ae15771cad2 100644
--- a/ntoskrnl/mm/pagefile.c
+++ b/ntoskrnl/mm/pagefile.c
@@ -152,7 +152,7 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
     IO_STATUS_BLOCK Iosb;
     NTSTATUS Status;
     KEVENT Event;
-    UCHAR MdlBase[sizeof(MDL) + sizeof(ULONG)];
+    UCHAR MdlBase[sizeof(MDL) + sizeof(PFN_NUMBER)];
     PMDL Mdl = (PMDL)MdlBase;
 
     DPRINT("MmWriteToSwapPage\n");
@@ -217,7 +217,7 @@ MiReadPageFile(
     IO_STATUS_BLOCK Iosb;
     NTSTATUS Status;
     KEVENT Event;
-    UCHAR MdlBase[sizeof(MDL) + sizeof(ULONG)];
+    UCHAR MdlBase[sizeof(MDL) + sizeof(PFN_NUMBER)];
     PMDL Mdl = (PMDL)MdlBase;
     PMMPAGING_FILE PagingFile;
 

Reply via email to