MiAllocatePartitionId
NTSTATUS __fastcall MiAllocatePartitionId(_MI_PARTITION *Partition){
_ETHREAD *CurrentThread;
UINT8 *v3;
unsigned int ClearBitsAndSet;
unsigned __int16 v5;
UINT8 *v6;
int v7;
unsigned int v8;
VOID *v10;
VOID *v11;
_TABLE_SEARCH_RESULT v12;
_TABLE_SEARCH_RESULT v13;
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
--CurrentThread->Tcb.SpecialApcDisable;
ExAcquirePushLockExclusiveEx((_EX_PUSH_LOCK *)&stru_140C4DB30 + 259, 0i64);
ClearBitsAndSet = (unsigned int)RtlFindClearBitsAndSet(*(&stru_140C4DB30 + 263), (VOID *)1, 0i64, v3, v10, v12);
v5 = ClearBitsAndSet;
if( ClearBitsAndSet == 0xFFFFFFFFi64 )
{
while( 1 )
{
MiExpandPartitionIds();
if( !v7 )
break;
v8 = (unsigned int)RtlFindClearBitsAndSet(*(&stru_140C4DB30 + 263), (VOID *)1, 0i64, v6, v11, v13);
v5 = v8;
if( v8 != 0xFFFFFFFFi64 )
goto LABEL_4;
}
if( (_InterlockedExchangeAdd64((_QWORD *)&stru_140C4DB30 + 259, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
ExfTryToWakePushLock((_EX_PUSH_LOCK *)&stru_140C4DB30 + 259);
KeAbPostRelease((char *)&stru_140C4DB30 + 2072);
KiLeaveGuardedRegionUnsafe((__int64)CurrentThread);
return 0;
}
else
{
LABEL_4:
*(&stru_140C4DB30 + 2156) = 1;
*(_QWORD *)(*(&stru_140C4DB30 + 267) + 8i64 * v5) = Partition;
if( (_InterlockedExchangeAdd64((_QWORD *)&stru_140C4DB30 + 259, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
ExfTryToWakePushLock((_EX_PUSH_LOCK *)&stru_140C4DB30 + 259);
KeAbPostRelease((char *)&stru_140C4DB30 + 2072);
KiLeaveGuardedRegionUnsafe((__int64)CurrentThread);
return v5;
}
}Referenced by:
No references.