IopIssueTrEERequest

NTSTATUS __stdcall IopIssueTrEERequest(
        UINT64 FunctionCode,
        FILE_OBJECT *FileObject,
        DEVICE_OBJECT *DeviceObject,
        PVOID InputBuffer,
        UINT64 InputBufferLength,
        PVOID OutputBuffer,
        UINT64 OutputBufferLength,
        UINT64 MinimumOutputSizeRequired,
        UINT64 *BytesWritten){
  NTSTATUS v9; 
  unsigned __int64 v10; 
  int v11; 
  UINT64 v13; 
  UINT64 v14; 
  UINT64 v15; 
  __int64 v16; 
  int v17; 
  int v18; 
  PVOID v19; 
  __int64 v20; 
  PVOID v21; 
  __int64 v22; 
  __int128 v23; 
  LODWORD(v15) = 0;
  v16 = 0i64;
  v17 = 0;
  v20 = (unsigned int)InputBufferLength;
  v22 = (unsigned int)OutputBufferLength;
  LODWORD(v14) = 16;
  v21 = OutputBuffer;
  v18 = FunctionCode;
  v19 = InputBuffer;
  LODWORD(v13) = 48;
  v23 = 0i64;
  v9 = IopIssueSystemEnvironmentRequest(0x568004ui64, 0, FileObject, DeviceObject, &v16, v13, &v23, v14, &v15);
  if( v9 >= 0 )
  {
    if( (unsigned int)v15 < 0x10 )
      return -1073741434;
    v10 = *((_QWORD *)&v23 + 1);
    if( BytesWritten )
    {
      v11 = -1;
      if( *((_QWORD *)&v23 + 1) <= 0xFFFFFFFFui64 )
        v11 = DWORD2(v23);
      *(_DWORD *)BytesWritten = v11;
      v9 = v10 > 0xFFFFFFFF ? 0xC0000095 : 0;
    }
    if( v10 < (unsigned int)MinimumOutputSizeRequired )
      return -1073741434;
  }
  return v9;
}

Referenced by:

IopEnumerateEnvironmentVariablesTrEE
IopGetEnvironmentVariableTrEE
IopQueryEnvironmentVariableInfoTrEE
IopSetEnvironmentVariableTrEE