MiLockImageSection
VOID __stdcall MiLockImageSection(
_KLDR_DATA_TABLE_ENTRY *DataTableEntry,
volatile INT64 *SectionLockCountPointer,
_MMPTE *PointerPte,
_MMPTE *LastPte){
_ETHREAD *CurrentThread;
unsigned __int32 v9;
unsigned __int32 v10;
int v11[8];
__int64 CompareAddress;
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
--*((_WORD *)CurrentThread + 242);
v9 = *(_DWORD *)SectionLockCountPointer;
do
{
while( 1 )
{
LODWORD(CompareAddress) = v9;
if( v9 != 1 )
break;
ExBlockOnAddressPushLock(&PushLock, SectionLockCountPointer, &CompareAddress, 4ui64, 0i64);
v9 = *(_DWORD *)SectionLockCountPointer;
}
v10 = v9;
v9 = _InterlockedCompareExchange((volatile signed __int32 *)SectionLockCountPointer, v9 + 1, v9);
}
while( v10 != v9 );
if( v9 < 2 )
{
MiLockCode((__int64)DataTableEntry, (unsigned __int64)PointerPte, (unsigned __int64)LastPte, 1);
_InterlockedIncrement((volatile signed __int32 *)SectionLockCountPointer);
_InterlockedOr(v11, 0);
if( PushLock.0 )
ExfUnblockPushLock(&PushLock, 0i64);
}
KeLeaveCriticalRegionThread((__int64)CurrentThread);
}Referenced by:
MiLockPagableImageSection