1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-05 10:41:50 +00:00
This commit is contained in:
momo5502
2022-04-01 20:45:41 +02:00
parent c62cc44a53
commit 0a26326bba
10 changed files with 980 additions and 26 deletions

View File

@ -68,15 +68,15 @@ namespace memory
return memory;
}
void* get_physical_address(void* address)
uint64_t get_physical_address(void* address)
{
return reinterpret_cast<void*>(MmGetPhysicalAddress(address).QuadPart);
return static_cast<uint64_t>(MmGetPhysicalAddress(address).QuadPart);
}
void* get_virtual_address(void* address)
void* get_virtual_address(const uint64_t address)
{
PHYSICAL_ADDRESS physical_address{};
physical_address.QuadPart = reinterpret_cast<LONGLONG>(address);
physical_address.QuadPart = static_cast<LONGLONG>(address);
return MmGetVirtualForPhysical(physical_address);
}