MmMapLockedPagesSpecifyCache
PVOID __stdcall MmMapLockedPagesSpecifyCache(
PMDL MemoryDescriptorList,
KPROCESSOR_MODE AccessMode,
MEMORY_CACHING_TYPE CacheType,
PVOID RequestedAddress,
UINT32 BugCheckOnFailure,
UINT32 Priority){
char *v8;
signed __int32 v9;
unsigned __int64 v10;
UINT32 v11;
unsigned __int64 v12;
unsigned __int64 v13;
unsigned int v14;
INT64 v15;
INT64 v16;
unsigned int v17;
void *v18;
unsigned int v19;
int v20;
__int16 MdlFlags;
char v22;
__int16 v23;
int v24;
void *v26;
CHAR v27;
UINT64 v28;
INT64 a6;
LODWORD(a6) = 0;
v8 = (char *)MemoryDescriptorList->StartVa + MemoryDescriptorList->ByteOffset;
if( AccessMode )
{
LODWORD(v28) = Priority;
LODWORD(v26) = MiMapLockedPagesInUserSpace(MemoryDescriptorList, v8, CacheType, RequestedAddress, v28);
v18 = v26;
if( !v26 )
return 0i64;
return v18;
}
v9 = Priority;
v10 = (((unsigned __int16)v8 & 0xFFF) + (unsigned __int64)MemoryDescriptorList->ByteCount + 4095) >> 12;
if( (Priority & 0x20) == 0 )
{
v11 = Priority & 0x3FFFFFFF;
v12 = 512i64;
if( (Priority & 0x3FFFFFFF) != 16 )
v12 = 2048i64;
v13 = v11 == 16 ? 0x2000000i64 : 0x4000000 / ((unsigned int)(v11 == 16) + 1);
if( ((qword_140C4DDE8 << 9) - qword_140C4ECB8) << 12 < v13
&& (v12 >= qword_140C4ECD8 || v10 >= qword_140C4ECD8 - v12)
&& (*((_DWORD *)KeGetCurrentThread() + 325) & 2) == 0
&& (*((_DWORD *)KeGetPcr() + 3243) & 0x10001) == 0 )
{
++dword_140C4ECA8;
return 0i64;
}
}
v14 = v10;
if( MmProtectFreedNonPagedPool == 1 )
v14 = v10 + 1;
v15 = MiReservePtes((INT64)&qword_140C4EC80, v14);
v16 = v15;
if( !v15 )
{
if( (MemoryDescriptorList->MdlFlags & 0x2000) != 0 || !BugCheckOnFailure )
return 0i64;
goto LABEL_39;
}
v17 = ((v9 >> 31) & 0xFFFFFFFD) + 4;
v18 = (void *)(MemoryDescriptorList->ByteOffset + (((v15 << 25) - ((_QWORD)MmGetPteBase() << 25)) >> 16));
if( (MiFlags & 0x10000) != 0 )
v9 = 0x40000000;
v19 = v17 | 2;
if( (v9 & 0x40000000) != 0 )
v19 = v17;
if( CacheType )
{
if( CacheType == MmWriteCombined )
v19 |= 0x18u;
}
else
{
v19 |= 8u;
}
LODWORD(v28) = 0;
v20 = MiFillSystemPtes(v15, v10, (INT64)&MemoryDescriptorList[1], v19, v28, (INT64)&a6);
MdlFlags = MemoryDescriptorList->MdlFlags;
if( v20 >= 0 )
{
v22 = a6;
v23 = MdlFlags | 1;
MemoryDescriptorList->MappedSystemVa = v18;
MemoryDescriptorList->MdlFlags = v23;
v24 = v22 & 1;
if( v24 )
{
MiMappingHasIoReferences(v18);
MemoryDescriptorList->MdlFlags |= 0x800u;
v23 = MemoryDescriptorList->MdlFlags;
}
if( (dword_140CFA17C & 1) != 0 )
{
if( MmProtectFreedNonPagedPool == 1 )
LOBYTE(v24) = v24 | 2;
v27 = MiProtectionToCacheAttribute(v19);
MiInsertPteTracker((INT64)MemoryDescriptorList, 0i64, v24, v27);
v23 = MemoryDescriptorList->MdlFlags;
}
if( (v23 & 0x10) != 0 )
MemoryDescriptorList->MdlFlags = v23 | 0x20;
return v18;
}
if( (MdlFlags & 0x2000) == 0 && BugCheckOnFailure )
LABEL_39:
MiIssueNoPtesBugcheck((unsigned int)v10);
MiReleasePtes((INT64)&qword_140C4EC80, v16, v14);
return 0i64;
}Referenced by:
AlpcpInitializeCompletionList
BgpFwAllocateMemory
CcCompleteAsyncRead
CcLockSystemCacheBuffer
EtwpAllocatePartitionMemory
EtwpAllocateTraceBuffer
ExInitializeLeapSecondData
ExLockUserBuffer
FsRtlCancelNotify
FsRtlNotifyCompleteIrp
FsRtlNotifyFilterReportChange
FsRtlNotifyFilterReportChangeLiteEx
HalAllocateCommonBufferVector
HalInitializeBios
HalpAllocateCommonBufferThin
HalpDmaAcquireBufferMappings
HalpDmaAllocateScatterMemory
HalpDmaCheckMdlAccessibility
HalpDmaFlushBuffer
HalpDmaSyncMapBuffers
IoReserveKsrPersistentMemory
IopLiveDumpAllocateFromVMMemoryPartition
IopSetFileObjectIosbRange
KeFlushIoBuffers
KiComputeNumaCosts
KiOpPatchCode
MdlInvariantPostProcessing1
MdlInvariantPreProcessing1
MiApplyImageHotPatch
MiCopyPagesIntoEnclave
MiCreateMdl
MiFlushFileOnlyMdl
MiFreePagesFromMdl
MiGetWorkingSetInfo
MiGetWorkingSetInfoList
MiInitializeImageProtos
MiLoadSectionIntoVsmEnclave
MiMapPageFileHash
MiQueryMemoryPhysicalContiguity
MiValidateInPage
MiValidatePagefilePageHash
MiWritePageFileHash
MmCopyVirtualMemory
MmMapLockedPages
NtPssCaptureVaSpaceBulk
NtStartProfile
PipGetPersistentMemory
PopAllocatePages
PpmHeteroInitializeHgsSupport
PsDispatchIumService
PspIumAllocatePhysicalPages
PspIumAllocateSecurePool
PspIumFreePhysicalPages
ResFwGetContext
SMKM_STORE_MGR::SmIoCtxWorkItemComplete
SMKM_STORE_MGR::SmPageWrite
SmFpAllocate
SmMapPage
SmPrepareForFatalPageError
VerifierMmMapLockedPagesSpecifyCache
VfFillAllocatePagesForMdl
ViAllocateMapRegisterFile
ViGetMdlBufferSa
ViMapDoubleBuffer
WbMakeUserDataPagesKernelWritable
WbMakeUserExecutablePagesKernelWritable