Fix MmMapHalMemory() not using the ReturnAddress for calculating virtual address
All checks were successful
Builds / ExectOS (i686) (push) Successful in 36s
Builds / ExectOS (amd64) (push) Successful in 39s

This commit is contained in:
Rafal Kupiec 2024-05-26 10:50:31 +02:00
parent 4a275b3dec
commit a7c4f6c2aa
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -186,14 +186,14 @@ MmMapHalMemory(IN PHYSICAL_ADDRESS PhysicalAddress,
}
/* Get PTE pointer and advance to next page */
PtePointer = (PHARDWARE_PTE)MmpGetPteAddress(VirtualAddress);
VirtualAddress = (PVOID)(ULONG_PTR)VirtualAddress + MM_PAGE_SIZE;
PtePointer = (PHARDWARE_PTE)MmpGetPteAddress(ReturnAddress);
ReturnAddress = (PVOID)(ULONG_PTR)ReturnAddress + MM_PAGE_SIZE;
/* Check if PTE is valid */
if(PtePointer->Valid)
{
/* PTE is not available, go to the next one */
BaseAddress = VirtualAddress;
BaseAddress = ReturnAddress;
MappedPages = 0;
continue;
}
@ -203,7 +203,7 @@ MmMapHalMemory(IN PHYSICAL_ADDRESS PhysicalAddress,
}
/* Take the actual base address with an offset */
VirtualAddress = (PVOID)(ULONG_PTR)(BaseAddress + PAGE_OFFSET(PhysicalAddress.LowPart));
ReturnAddress = (PVOID)(ULONG_PTR)(BaseAddress + PAGE_OFFSET(PhysicalAddress.LowPart));
/* Check if base address starts at the beginning of the heap */
if(BaseAddress == MmpHalHeapStart)