What is the trick in pAddress & ~(PAGE_SIZE - 1) to get the page's start address
- by Dbger
Following function is used to get the page's start address of an address which in side this page:
void* GetPageAddress(void* pAddress)
{
return (void*)((ULONG_PTR)pAddress & ~(PAGE_SIZE - 1));
}
But I couldn't quite get to it, what is the trick it plays here?