PipVisitDeviceObjectListEntry

NTSTATUS __stdcall PipVisitDeviceObjectListEntry(
        _DEVICE_OBJECT_LIST_ENTRY *Device,
        _DEVICE_OBJECT_LIST *List,
        UINT64 *Ordinal){
  unsigned int Flags; 
  _DEVICE_OBJECT *DeviceObject; 
  _DEVICE_OBJECT *DeviceNode; 
  __int64 v9; 
  _DEVICE_OBJECT_LIST_ENTRY *v10; 
  _DEVICE_OBJECT *v11; 
  _LIST_ENTRY *DependentList; 
  _LIST_ENTRY *Flink; 
  unsigned int v14; 
  char v16; 
  _DEVICE_OBJECT *Dependent; 
  UINT64 DependencyTypes; 
  _DEVICE_OBJECT_LIST_ENTRY *Devicea; 

  Dependent = 0i64;
  Devicea = 0i64;
  Flags = Device->Flags;
  if( (Flags & 2) == 0 )
  {
    Device->Flags = Flags | 2;
    DeviceObject = Device->DeviceObject;
    if( DeviceObject )
      DeviceNode = (_DEVICE_OBJECT *)DeviceObject->DeviceObjectExtension->DeviceNode;
    else
      DeviceNode = 0i64;
    v9 = 0i64;
    if( List->Count )
    {
      do
      {
        v10 = (_DEVICE_OBJECT_LIST_ENTRY *)((char *)List->Devices + 16 * v9 + 8 * v9);
        v11 = v10->DeviceObject;
        Devicea = v10;
        if( v11 )
          v11 = (_DEVICE_OBJECT *)v11->DeviceObjectExtension->DeviceNode;
        if( v11->NextDevice == DeviceNode
          || (_DEVICE_OBJECT *)((unsigned __int64)v11[1].DeviceObjectExtension & 0xFFFFFFFFFFFFFFFEui64) == DeviceNode )
        {
          PipVisitDeviceObjectListEntry(v10, List, Ordinal);
        }
        v9 = (unsigned int)(v9 + 1);
      }
      while( (unsigned int)v9 < List->Count );
      DeviceObject = Device->DeviceObject;
    }
    DependentList = PiGetDependentList(DeviceObject);
    Flink = DependentList->Flink;
    while( Flink != DependentList )
    {
      PiEnumerateDependentListEntry(Flink, &Dependent, &DependencyTypes);
      Flink = Flink->Flink;
      if( Dependent )
      {
        PipIsDeviceInDeviceObjectList();
        if( v16 )
          PipVisitDeviceObjectListEntry(Devicea, List, Ordinal);
      }
    }
    v14 = *(_DWORD *)Ordinal;
    Device->Ordinal = *(_DWORD *)Ordinal;
    *(_DWORD *)Ordinal = v14 + 1;
  }
  return 0;
}

Referenced by:

PipVisitDeviceObjectListEntry