ExpPartitionCreatePool
INT64 __fastcall ExpPartitionCreatePool(INT64 a1, INT64 a2, INT64 a3, UINT64 *a4){
bool v6;
unsigned int v7;
unsigned int v8;
INT64 v9;
INT64 result;
unsigned __int16 v11;
INT64 v12;
__int64 v13;
signed int v14;
do
{
v6 = !_BitScanForward(&v7, *(_DWORD *)(a1 + 24));
v14 = v7;
if( v6 )
return 3221225495i64;
}
while( !_interlockedbittestandreset((volatile signed __int32 *)(a1 + 24), v7) );
v8 = v7;
LODWORD(v12) = v7;
v9 = *((_QWORD *)KeGetCurrentPrcb() + 24);
if( *((__int64 **)&KeNodeBlock + *(unsigned __int16 *)(v9 + 146)) == &KiNodeInit[48 * *(unsigned __int16 *)(v9 + 146)] )
v9 = 0i64;
result = ExpPartitionCreatePoolInternal(a1, 1i64, 16i64, v9, v12);
if( (int)result >= 0 )
{
v11 = 0;
if( KeNumberNodes )
{
v13 = (2 * (*(unsigned __int16 *)(v9 + 146) & 0x7Fu)) | 1i64;
do
{
if( v11 != *(_WORD *)(v9 + 146) )
{
v8 = v14;
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 8i64 * v11) + 8i64 * v14) = v13;
KeSetEvent((PRKEVENT)(*(_QWORD *)(*(_QWORD *)(a1 + 16) + 8i64 * v11) + 16i64), 0);
}
++v11;
}
while( v11 < (unsigned __int16)KeNumberNodes );
}
*(_DWORD *)a4 = v8;
result = 0i64;
v8 = 8;
}
if( v8 != 8 )
_interlockedbittestandset((volatile signed __int32 *)(a1 + 24), v8);
return result;
}Referenced by:
ExAllocatePrivateWorkerPool