RtlFindNextForwardRunClear
UINT64 __stdcall RtlFindNextForwardRunClear(RTL_BITMAP *BitMapHeader, UINT64 FromIndex, UINT64 *StartingRunIndex){
unsigned int SizeOfBitMap;
unsigned int v5;
unsigned int *Buffer;
unsigned int *v8;
unsigned int *v9;
unsigned int v10;
int v11;
unsigned int v12;
unsigned int i;
unsigned int *v16;
SizeOfBitMap = BitMapHeader->SizeOfBitMap;
v5 = FromIndex;
if( BitMapHeader->SizeOfBitMap <= (unsigned int)FromIndex )
{
*(_DWORD *)StartingRunIndex = FromIndex;
return 0;
}
Buffer = BitMapHeader->Buffer;
v8 = &Buffer[(unsigned __int64)(SizeOfBitMap - 1) >> 5];
v9 = &Buffer[(unsigned __int64)v5 >> 5];
if( v9 != v8 && (*v9 | *((_DWORD *)qword_140011CE0 + (v5 & 0x1F))) == -1 )
{
v5 = v5 - (v5 & 0x1F) + 32;
for( ++v9; v9 < v8 && *v9 == -1; ++v9 )
v5 += 32;
}
for( ; v5 < SizeOfBitMap; ++v5 )
{
if( !_bittest((const signed __int32 *)BitMapHeader->Buffer, v5) )
break;
}
v10 = 0;
if( v9 == v8 )
goto LABEL_13;
v11 = v5 & 0x1F;
if( (*v9 & ~*((_DWORD *)qword_140011CE0 + (v5 & 0x1F))) != 0 )
goto LABEL_13;
v10 = 32 - v11;
if( v11 != 33 )
{
v16 = v9 + 1;
while( v16 < v8 && !*v16 )
{
++v16;
v10 += 32;
if( v10 == -1 )
goto LABEL_17;
}
LABEL_13:
v12 = BitMapHeader->SizeOfBitMap;
for( i = v10 + v5; i < v12; ++v10 )
{
if( _bittest((const signed __int32 *)BitMapHeader->Buffer, i) )
break;
if( v10 == -1 )
break;
++i;
}
}
LABEL_17:
*(_DWORD *)StartingRunIndex = v5;
return v10;
}Referenced by:
HalpIrtAllocateIndex
HvpCountSetRangesInVector
HvpGenerateLogMetadata
MiFindDriverNonPagedSections
MiPrepareToHotPatchImage
PnprMirrorMarkedPages
PopGetRemainingHibernateRangeDataSize
ViThunkSnapSharedExports