26#if defined(_GLOBAL_PAGES_ARE_AWESOME_)
39#if defined(_GLOBAL_PAGES_ARE_AWESOME_)
64 DPRINT(
"PAT support detected but not yet taken advantage of\n");
91 AddressMask.
LowPart = 0xFFFFFFFF;
95 if (InLower4Gb) AddressMask.
HighPart = 0;
133 if (!NewPage)
return FALSE;
212 DPRINT1(
"Failed to get buffer for large pages identity mapping\n");
240 DPRINT(
"IdentityMap->Cr3 0x%x\n", IdentityMap->
Cr3);
251 DPRINT(
"Freeing %lu pages allocated for identity mapping\n", IdentityMap->
PagesCount);
PVOID NTAPI MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS HighestAcceptableAddress)
VOID NTAPI MmFreeContiguousMemory(IN PVOID BaseAddress)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
__INTRIN_INLINE unsigned long __readcr3(void)
__INTRIN_INLINE unsigned long __readcr4(void)
__INTRIN_INLINE void __writecr3(unsigned int Data)
__INTRIN_INLINE void __writecr4(unsigned int Data)
_In_ ULONG _In_ ULONG _In_ ULONG Length
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
FORCEINLINE BOOLEAN KeDisableInterrupts(VOID)
FORCEINLINE VOID KeRestoreInterrupts(BOOLEAN WereEnabled)
struct _LARGE_IDENTITY_MAP * PLARGE_IDENTITY_MAP
VOID NTAPI Ki386EnableCurrentLargePage(IN ULONG_PTR StartAddress, IN ULONG Cr3)
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
BOOLEAN NTAPI Ki386IdentityMapMakeValid(PLARGE_IDENTITY_MAP IdentityMap, PHARDWARE_PTE Pde, PHARDWARE_PTE *PageTable)
VOID NTAPI KiInitializePAT(VOID)
PHYSICAL_ADDRESS NTAPI Ki386BuildIdentityBuffer(PLARGE_IDENTITY_MAP IdentityMap, PVOID StartPtr, ULONG Length)
ULONG_PTR NTAPI Ki386EnableTargetLargePage(IN ULONG_PTR Context)
PVOID NTAPI Ki386AllocateContiguousMemory(PLARGE_IDENTITY_MAP IdentityMap, ULONG PagesCount, BOOLEAN InLower4Gb)
BOOLEAN NTAPI Ki386MapAddress(PLARGE_IDENTITY_MAP IdentityMap, ULONG_PTR VirtualPtr, PHYSICAL_ADDRESS PhysicalPtr)
VOID NTAPI Ki386ConvertPte(PHARDWARE_PTE Pte)
VOID NTAPI Ki386FreeIdentityMap(PLARGE_IDENTITY_MAP IdentityMap)
ULONG_PTR NTAPI Ki386EnableGlobalPage(IN ULONG_PTR Context)
BOOLEAN NTAPI Ki386CreateIdentityMap(PLARGE_IDENTITY_MAP IdentityMap, PVOID StartPtr, ULONG PagesCount)
PHARDWARE_PTE TopLevelDirectory
static PMEM_HOOK PageTable[TOTAL_PAGES]
#define RtlZeroMemory(Destination, Length)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO