HalpIommuGetDeviceId

NTSTATUS __stdcall HalpIommuGetDeviceId(PDEVICE_OBJECT DeviceObject){
  __int64 *v1; 
  __int64 *v2; 
  __int64 v4; 
  struct _DMA_ADAPTER *InterfaceSpecificData; 
  int Interface; 
  int v7; 
  __int64 v8; 
  __int64 v9; 
  INTERFACE result[2]; 
  __int64(__fastcall *v12)(void *, __int64, __int64, __int64 *); 
  __int64 v13; 
  v2 = v1;
  memset((INT64)result, 0i64);
  v13 = 0i64;
  v4 = 0i64;
  InterfaceSpecificData = (struct _DMA_ADAPTER *)IoGetDeviceAttachmentBaseRef(DeviceObject);
  Interface = IoQueryInterface(DeviceObject, 0, &GUID_IOMMU_BUS_INTERFACE, 0x50u, 2u, InterfaceSpecificData, result);
  HalPutDmaAdapter(InterfaceSpecificData);
  if( Interface >= 0 )
  {
    v7 = v12(result[0].Context, 0i64, 0i64, &v13);
    Interface = v7;
    if( v7 == -1073741789 )
    {
      if( v13 )
      {
        v9 = HalpMmAllocCtxAlloc(v8, v13);
        v4 = v9;
        if( v9 )
          Interface = v12(result[0].Context, v13, v9, 0i64);
        else
          Interface = -1073741670;
        goto LABEL_6;
      }
    }
    else if( v7 < 0 )
    {
LABEL_6:
      result[0].InterfaceDereference(result[0].Context);
      goto LABEL_7;
    }
    Interface = -1073741823;
    goto LABEL_6;
  }
LABEL_7:
  *v2 = v4;
  return Interface;
}

Referenced by:

HalpQueryIommuReservedRegionInformation
IommuDomainAttachDevice