https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03283371c101521b7eab459c2be71ecce6f0a1d8

commit 03283371c101521b7eab459c2be71ecce6f0a1d8
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Wed Jan 4 23:17:57 2023 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Thu Sep 28 01:19:47 2023 +0300

    [NTOS/Mm] Fix SWAPENTRY bit-check in MmCreatePageFileMapping
    
    Test for the highest bit, not for bit 3 / 7.
---
 ntoskrnl/mm/i386/page.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c
index e0f7a304c8b..df13cb013e2 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 << (sizeof(SWAPENTRY) - 1)))
+    if (SwapEntry & ((ULONG_PTR)1 << (RTL_BITS_OF(SWAPENTRY) - 1)))
     {
         KeBugCheck(MEMORY_MANAGEMENT);
     }

Reply via email to