IoEnumerateDeviceObjectList

NTSTATUS __stdcall IoEnumerateDeviceObjectList(
        _DRIVER_OBJECT *DriverObject,
        _DEVICE_OBJECT **DeviceObjectList,
        UINT64 DeviceObjectListSize,
        UINT64 *ActualNumberDeviceObjects){
  unsigned int v5; 
  unsigned int v7; 
  _DEVICE_OBJECT **v8; 
  UINT8 v9; 
  _DEVICE_OBJECT *DeviceObject; 
  UINT8 v11; 
  unsigned int v12; 
  bool v13; 
  _DEVICE_OBJECT *v14; 
  unsigned int i; 

  v5 = 0;
  v7 = DeviceObjectListSize;
  v8 = DeviceObjectList;
  v9 = KeAcquireQueuedSpinLock(10i64, (INT64)DeviceObjectList, DeviceObjectListSize);
  DeviceObject = DriverObject->DeviceObject;
  v11 = v9;
  v12 = v7 >> 3;
  while( DeviceObject )
  {
    DeviceObject = DeviceObject->NextDevice;
    ++v5;
  }
  v13 = v12 < v5;
  *(_DWORD *)ActualNumberDeviceObjects = v5;
  v14 = DriverObject->DeviceObject;
  for( i = v13 ? 0xC0000023 : 0; v12; --v12 )
  {
    if( !v14 )
      break;
    ObfReferenceObjectWithTag(v14, 0x746C6644ui64);
    *v8++ = v14;
    v14 = v14->NextDevice;
  }
  KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, v11);
  return i;
}

Referenced by:

No references.