Memory Tracker: If PageTable is nullptr, read the current one

This commit is contained in:
Alex 2022-12-17 19:02:07 +02:00
parent 32e8eecc69
commit 013b635524
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,10 @@ namespace Memory
Tracker::Tracker(PageTable4 *PageTable)
{
this->PageTable = PageTable;
if (PageTable)
this->PageTable = PageTable;
else
this->PageTable = (PageTable4 *)CPU::x64::readcr3().raw;
debug("Tracker initialized.");
}

View File

@ -651,7 +651,7 @@ namespace Memory
void *RequestPages(uint64_t Count);
void FreePages(void *Address, uint64_t Count);
Tracker(PageTable4 *PageTable);
Tracker(PageTable4 *PageTable = nullptr);
~Tracker();
};
}