PfpServiceMainThreadBoostPrep

__int64 __fastcall PfpServiceMainThreadBoostPrep(__int64 a1, _QWORD *a2){
  void *v3; 
  NTSTATUS v5; 
  PVOID v6; 
  unsigned int v7; 
  VOID *PoolWithTag; 
  PVOID Object; 
  Object = 0i64;
  v3 = *(void **)(a1 + 72);
  if( !v3 )
    return(unsigned int)-2147483614;
  v5 = PsLookupThreadByThreadId(v3, (PETHREAD *)&Object);
  v6 = Object;
  v7 = v5;
  if( v5 >= 0 )
  {
    if( *((_QWORD *)Object + 134) == *(_QWORD *)(a1 + 80) )
    {
      PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, 0xA8ui64, 0x44506650ui64);
      if( PoolWithTag )
      {
        *a2 = v6;
        v7 = 0;
        a2[1] = PoolWithTag;
        return v7;
      }
      v7 = -1073741670;
    }
    else
    {
      v7 = -1073741735;
    }
  }
  if( v6 )
    ObDereferenceObjectDeferDelete(v6);
  return v7;
}

Referenced by:

PfpScenCtxScenarioSet