IopEnumerateRelations

bool __fastcall IopEnumerateRelations(unsigned int **a1, int *a2, _QWORD *a3, _DWORD *a4, int *a5){
  bool v5; 
  int v7; 
  unsigned int *v8; 
  unsigned int v9; 
  unsigned int v10; 
  v5 = 0;
  *a3 = 0i64;
  if( a4 )
    *a4 = 0;
  if( a5 )
    *a5 = 0;
  v7 = *a2;
  if( !*a2 || *((_BYTE *)a1 + 8) )
  {
    v8 = *a1;
    v9 = a2[1];
    v10 = **a1;
    if( v9 < v10 && v7 >= 0 )
    {
      if( v7 > 1 )
      {
        if( v7 != 2 )
          return v5;
        v9 = v10 + ~v9;
      }
      v5 = (int)PipDeviceObjectListElementAt(v8, v9, a3, a4, a5) >= 0;
      ++a2[1];
    }
  }
  return v5;
}

Referenced by:

IopCheckIfMergeRequired
PiEventBuildPdoList
PiProcessCanceledRemoveForReset
PiRestartRemovalRelations
PnpBuildUnsafeRemovalDeviceList
PnpCancelRemoveOnHungDevices
PnpCompileDeviceInstancePaths
PnpDeleteLockedDeviceNodes
PnpInvalidateRelationsInList
PnpProcessQueryRemoveAndEject
PnpQueuePendingSurpriseRemoval
PnpTrackQueryRemoveDevices
PnpUnlinkDeviceRemovalRelations