PnpProcessDependencyRelations

INT64 __fastcall PnpProcessDependencyRelations(
        _DEVICE_NODE *DeviceNode,
        _PNP_DEVICE_DELETE_TYPE OperationCode,
        _DEVICE_RELATION_LEVEL RelationLevel,
        _PNP_VETO_TYPE *VetoType,
        _UNICODE_STRING *VetoName,
        _RELATION_LIST *RelationsList){
  DEVICE_OBJECT *v6; 
  int v10; 
  LIST_ENTRY *DependentList; 
  LIST_ENTRY *Flink; 
  _UNICODE_STRING *v14; 
  __int64 v15; 
  int v16; 
  bool v17; 
  _RELATION_LIST *v18; 
  DEVICE_OBJECT *Dependent; 
  UINT64 DependencyTypes; 
  v6 = (DEVICE_OBJECT *)*((_QWORD *)DeviceNode + 4);
  Dependent = 0i64;
  v10 = 0;
  PnpAcquireDependencyRelationsLock(0);
  DependentList = PiGetDependentList(v6);
  Flink = DependentList->Flink;
  if( DependentList->Flink != DependentList )
  {
    v14 = VetoName;
    do
    {
      PiEnumerateDependentListEntry(Flink, &Dependent, &DependencyTypes);
      Flink = Flink->Flink;
      if( Dependent )
      {
        v15 = *(_QWORD *)(*((_QWORD *)Dependent + 39) + 40i64);
        v16 = *(_DWORD *)(v15 + 300);
        if( v16 < 782 || v16 > 783 )
          v17 = (unsigned __int8)PipIsDevNodeDNStarted((_DEVICE_NODE *)v15) == 0;
        else
          v17 = ((*(_DWORD *)(v15 + 304) - 786) & 0xFFFFFFFD) == 0;
        if( !v17 )
          v10 = PnpProcessRelation((_DEVICE_NODE *)v15, OperationCode, RelationLevel, VetoType, v14, v18);
        if( v10 < 0 )
          break;
      }
    }
    while( Flink != DependentList );
  }
  ExReleaseResourceLite(&PiDependencyRelationsLock);
  PpDevNodeUnlockTree(0);
  return(unsigned int)v10;
}

Referenced by:

PnpProcessRelation