IoReportResourceUsageInternal

NTSTATUS __stdcall IoReportResourceUsageInternal(
        _ARBITER_REQUEST_SOURCE AllocationType,
        _UNICODE_STRING *DriverClassName,
        _DRIVER_OBJECT *DriverObject,
        _CM_RESOURCE_LIST *DriverList,
        UINT64 DriverListSize,
        _DEVICE_OBJECT *DeviceObject,
        _CM_RESOURCE_LIST *DeviceList,
        UINT64 DeviceListSize,
        UINT8 OverrideConflict,
        UINT8 *ConflictDetected){
  _CM_RESOURCE_LIST *v10; 
  NTSTATUS v11; 
  VOID **v14; 
  UINT8 *v16; 
  unsigned int v17; 
  char v18; 
  int v19; 
  PVOID P; 

  P = DriverClassName;
  v10 = DeviceList;
  v11 = 0;
  if( !DeviceList )
    v10 = DriverList;
  v14 = 0i64;
  if( v10 )
  {
    if( v10->Count && v10->List[0].PartialResourceList.Count )
    {
      v14 = PnpCmResourcesToIoResources(*(__int64 *)&AllocationType, v10, 12288);
      if( !v14 )
        return -1073741823;
    }
    else
    {
      v10 = 0i64;
    }
  }
  v16 = ConflictDetected;
  v17 = 0;
  P = v10;
  v18 = 0;
  *ConflictDetected = 1;
  while( 1 )
  {
    v19 = IopLegacyResourceAllocation(
            AllocationType,
            DriverObject,
            DeviceObject,
            (_IO_RESOURCE_REQUIREMENTS_LIST *)v14,
            (_CM_RESOURCE_LIST **)&P);
    if( v19 >= 0 )
      break;
    if( IopChangeInterfaceType((_IO_RESOURCE_REQUIREMENTS_LIST *)v14, (_CM_RESOURCE_LIST **)&P) )
    {
      ++v17;
      v18 = 1;
      if( v17 < 2 )
        continue;
    }
    goto LABEL_15;
  }
  *v16 = 0;
LABEL_15:
  if( v14 )
    ExFreePoolWithTag(v14, 0);
  if( v18 )
    ExFreePoolWithTag(P, 0);
  if( v19 < 0 )
  {
    if( v19 != -1073741670 )
      return -1073741800;
    return v19;
  }
  return v11;
}

Referenced by:

IoReportDetectedDevice
IoReportResourceForDetection
IoReportResourceUsage