RtlpWriteExtendedContext

NTSTATUS __fastcall RtlpWriteExtendedContext(INT64 a1, INT64 a2, INT64 a3, UINT64 a4, INT64 a5){
  unsigned int v5; 
  NTSTATUS result; 
  UINT64 Alignment; 
  UINT64 v10; 
  v5 = a4;
  LODWORD(v10) = 0;
  LODWORD(Alignment) = 0;
  result = RtlpValidateContextFlags((unsigned int)a4, &v10);
  if( result >= 0 )
  {
    RtlpGetLegacyContextLength(v5, 0i64, &Alignment);
    if( (v10 & 1) != 0 )
      ProbeForWrite((VOID *)(a2 + *(int *)(a3 + 8)), *(unsigned int *)(a3 + 12), (unsigned int)Alignment);
    if( (v10 & 2) != 0 )
      ProbeForWrite((VOID *)(a2 + *(int *)(a3 + 16)), *(unsigned int *)(a3 + 20), 0x40ui64);
    return RtlpCopyExtendedContext(1, a2, a3, v5, a5, 0i64);
  }
  return result;
}

Referenced by:

PspGetContextThreadInternal
PspWow64GetContextThread