PnpIsAnyDeviceInUse

UINT64 __stdcall PnpIsAnyDeviceInUse(DEVICE_OBJECT **DeviceObjects, DEVICE_OBJECT **VetoingDevice){
  DEVICE_OBJECT **v2; 
  UINT64 result; 
  DEVICE_OBJECT *i; 
  int v5; 
  int v6; 
  result = 0i64;
  i = 0i64;
  v5 = 0;
  v6 = 0;
  do
  {
    if( v5 )
      break;
    for( i = *DeviceObjects; i; i = (DEVICE_OBJECT *)*((_QWORD *)i + 3) )
    {
      v5 = *((_DWORD *)i + 1);
      if( v5 )
        break;
    }
    ++v6;
    ++DeviceObjects;
  }
  while( !v6 );
  if( v2 )
    *v2 = i;
  LOBYTE(result) = v5 != 0;
  return result;
}

Referenced by:

IopCompleteUnloadOrDelete
PnpIsChainDereferenced