void CUsbDkHubFilterStrategy::WipeHiddenDevices(CDeviceRelations &Relations) { Relations.WipeIf([this](PDEVICE_OBJECT PDO) { bool Hide = false; Children().ForEachIf([PDO](CUsbDkChildDevice *Child){ return Child->Match(PDO); }, [this, &Hide](CUsbDkChildDevice *Child) { Hide = false; if (!Child->IsRedirected() && !Child->IsIndicated()) { Hide = m_ControlDevice->ShouldHide(Child->DeviceDescriptor()); } if (!Hide) { Child->MarkAsIndicated(); } else { TraceEvents(TRACE_LEVEL_ERROR, TRACE_FILTERDEVICE, "%!FUNC! Hiding child object:"); Child->Dump(); } return false; }); return Hide; }); }
void CUsbDkHubFilterStrategy::WipeHiddenDevices(CDeviceRelations &Relations) { Relations.WipeIf([this](PDEVICE_OBJECT PDO) { bool Hide = false; Children().ForEachIf([PDO](CUsbDkChildDevice *Child){ return Child->Match(PDO); }, [this, &Hide](CUsbDkChildDevice *Child) { Hide = false; if (!Child->IsRedirected() && !Child->IsIndicated()) { Hide = m_ControlDevice->ShouldHide(Child->DeviceDescriptor()); } if (!Hide) { Child->MarkAsIndicated(); } return false; }); return Hide; }); }
void CUsbDkHubFilterStrategy::DropRemovedDevices(const CDeviceRelations &Relations) { //Child device must be deleted on PASSIVE_LEVEL //So we put those to non-locked list and let its destructor do the job CWdmList<CUsbDkChildDevice, CRawAccess, CNonCountingObject> ToBeDeleted; Children().ForEachDetachedIf([&Relations](CUsbDkChildDevice *Child) { return !Relations.Contains(*Child); }, [&ToBeDeleted](CUsbDkChildDevice *Child) -> bool { ToBeDeleted.PushBack(Child); return true; }); }
void CUsbDkHubFilterStrategy::AddNewDevices(const CDeviceRelations &Relations) { Relations.ForEachIf([this](PDEVICE_OBJECT PDO){ return !IsChildRegistered(PDO); }, [this](PDEVICE_OBJECT PDO){ RegisterNewChild(PDO); return true; }); }