PipRemoveDevicesInRelationList

NTSTATUS __stdcall PipRemoveDevicesInRelationList(PENDING_RELATIONS_LIST_ENTRY *Entry){
  __int64 v1; 
  __int64 v3; 
  bool v4; 
  NTSTATUS v5; 
  __int64 v6; 

  v1 = *((_QWORD *)Entry + 7);
  if( v1 )
    v3 = *(_QWORD *)(*(_QWORD *)(v1 + 312) + 40i64);
  else
    v3 = 0i64;
  if( v3 )
  {
    v4 = 0;
    if( (*(_DWORD *)(v3 + 396) & 0x10) == 0 )
      v4 = *(_QWORD *)(v3 + 16) != 0i64;
    v5 = IopSortRelationListForRemove(*((_RELATION_LIST **)Entry + 8));
    PnpDeleteLockedDeviceNodes(
      *((_DEVICE_OBJECT **)Entry + 7),
      *((_RELATION_LIST **)Entry + 8),
      2,
      0,
      Entry[21],
      0,
      0i64,
      0i64);
    if( v4 )
    {
      if( *(_DWORD *)(v3 + 300) == 782 )
        IopRemoveRelationFromList(*((_RELATION_LIST **)Entry + 8), *((PDEVICE_OBJECT *)Entry + 7));
      PnpUnlinkDeviceRemovalRelations(v6, *((_RELATION_LIST **)Entry + 8));
    }
  }
  else
  {
    v5 = -1073741823;
  }
  IopFreeRelationList(*((_RELATION_LIST **)Entry + 8));
  ExFreePoolWithTag(Entry, 0);
  return v5;
}

Referenced by:

PnpDelayedRemoveWorker