[NTOS/Mm] Fix SWAPENTRY bit-check in MmCreatePageFileMapping

Test for the highest bit, not for bit 3 / 7.
This commit is contained in:
Timo Kreuzer 2023-01-04 23:17:57 +02:00
parent 058b746bbe
commit 03283371c1

View File

@ -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);
}