RtlpHpSegSetExtraPresent

NTSTATUS __stdcall RtlpHpSegSetExtraPresent(INT64 a1, UINT64 a2){
  UINT64 v2; 
  INT64 v3; 
  __int64 v4; 
  unsigned __int8 v5; 
  __int64 v6; 
  unsigned __int64 v7; 

  v2 = RtlpHpSegDescriptorValidate(a1, a2);
  v5 = *(_BYTE *)(v2 + 24) & 0xC;
  if( v5 < 8u )
  {
    *(_WORD *)(v2 + 8) |= 1u;
  }
  else if( v5 == 8 )
  {
    v6 = ((__int64)(v2 - (v2 & *(_QWORD *)v4)) >> 5 << *(_BYTE *)(v4 + 8)) + (v2 & *(_QWORD *)v4);
    v7 = WORD4(RtlpHpHeapGlobals) ^ *(unsigned __int16 *)(v6 + 40) ^ (unsigned __int64)(unsigned __int16)((unsigned int)v6 >> 12);
    LODWORD(v2) = 0x4000;
    *(_WORD *)(v7 + v3 - 2) |= 0x4000u;
  }
  else
  {
    LODWORD(v2) = RtlpHpVsChunkSetExtraPresent(*(_QWORD *)(v4 + 32), v3);
  }
  return v2;
}

Referenced by:

RtlpHpExtrasSetPresent