IopRetrieveTransactionParameters

INT64 __fastcall IopRetrieveTransactionParameters(DEVICE_OBJECT *DeviceObject, INT64 a2, INT64 a3, FILE_OBJECT *a4){
  int v5; 
  INT64 result; 
  int v9; 
  _ETHREAD *CurrentThread; 
  __int64 v11; 
  _WORD *v12; 
  __int16 v13; 
  int v14; 
  HANDLE Handle; 
  PVOID Object; 
  void *TypeExt[8]; 
  v5 = a3;
  TypeExt[0] = 0i64;
  Handle = 0i64;
  v13 = 0;
  result = TmCurrentTransaction(&Handle);
  v9 = result;
  v14 = result;
  if( (_DWORD)result == -1073741637 )
  {
    v9 = 0;
    v14 = 0;
  }
  else if( (int)result < 0 )
  {
    return result;
  }
  if( Handle )
  {
    CurrentThread = (_ETHREAD *)KeGetCurrentThread();
    if( (*((_DWORD *)CurrentThread + 29) & 0x400) != 0
      || *((_BYTE *)CurrentThread + 586) == 1
      || (v11 = *((_QWORD *)CurrentThread + 30)) == 0 )
    {
      v9 = -1072103400;
    }
    else
    {
      v13 = *(_WORD *)(v11 + 744);
      v9 = v14;
    }
  }
  if( v9 < 0 || !Handle )
    return(unsigned int)v9;
  if( IopCheckStackForTransactionSupport(DeviceObject)
    || (*(_WORD *)(a2 + 70) &= 1u, *(_DWORD *)(a2 + 88) == 1) && (v5 & 0xFEEDFF56) == 0
    || *(_BYTE *)(a2 + 137) )
  {
    Object = 0i64;
    if( ObReferenceObjectByHandle(Handle, 0x120037u, (POBJECT_TYPE)TmTransactionObjectType, 1, &Object, 0i64) < 0 )
    {
      return(unsigned int)-1072103400;
    }
    else
    {
      IopGetSetSpecificExtension(a4, FoExtTypeTransactionParams, 0x10ui64, 1u, TypeExt, 0i64);
      v9 = result;
      if( (int)result >= 0 )
      {
        v12 = TypeExt[0];
        *(_WORD *)TypeExt[0] = 16;
        v12[1] = v13;
        *((_QWORD *)v12 + 1) = Object;
        return(unsigned int)result;
      }
      HalPutDmaAdapter((PADAPTER_OBJECT)Object);
    }
    return(unsigned int)v9;
  }
  return 3222863935i64;
}

Referenced by:

IopAllocRealFileObject
IopParseDevice