RtlpHpExtrasSetPresent

NTSTATUS __fastcall RtlpHpExtrasSetPresent(PVOID Va, UINT64 a2){
  int v2; 
  _RTL_RUN_ONCE *HeapManager; 
  __int64 v6; 
  __int64 v7; 
  __int128 v9; 

  v2 = 0;
  if( !(_WORD)a2 )
  {
    v9 = *(_OWORD *)Va;
    HeapManager = RtlpHpEnvGetHeapManager(&v9);
    LODWORD(v7) = RtlCSparseBitmapBitmaskRead((INT64)&HeapManager[2], 2 * ((v6 - HeapManager[1].Value) >> 20));
    if( !v7 )
      return RtlpHpLargeAllocSetExtraPresent(Va, a2);
    v2 = v7 - 1;
  }
  if( v2 == 2 )
    return RtlpHpLargeAllocSetExtraPresent(Va, a2);
  return RtlpHpSegSetExtraPresent((INT64)Va + 192 * v2 + 256, a2);
}

Referenced by:

RtlpHpExtrasAppend