Use PHYSICAL_ADDRESS data type in MmAllocateHardwareMemory() routine as it is used in MmMapHardwareMemory() as well to avoid the need of data conversion

This commit is contained in:
2024-07-13 15:54:10 +02:00
parent ceb36ae8ec
commit cb64235953
2 changed files with 4 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ XTAPI
XTSTATUS
MmAllocateHardwareMemory(IN PFN_NUMBER PageCount,
IN BOOLEAN Aligned,
OUT PULONG_PTR Buffer)
OUT PPHYSICAL_ADDRESS Buffer)
{
PLOADER_MEMORY_DESCRIPTOR Descriptor, ExtraDescriptor, HardwareDescriptor;
PFN_NUMBER Alignment, MaxPage;
@@ -37,7 +37,7 @@ MmAllocateHardwareMemory(IN PFN_NUMBER PageCount,
PLIST_ENTRY ListEntry;
/* Assume failure */
*Buffer = 0;
(*Buffer).QuadPart = 0;
/* Calculate maximum page address */
MaxPage = MM_MAXIMUM_PHYSICAL_ADDRESS >> MM_PAGE_SHIFT;
@@ -135,7 +135,7 @@ MmAllocateHardwareMemory(IN PFN_NUMBER PageCount,
}
/* Return physical address */
*Buffer = PhysicalAddress;
(*Buffer).QuadPart = PhysicalAddress;
return STATUS_SUCCESS;
}