Skip to content

Commit

Permalink
UsbDk: Retire old hiding logic
Browse files Browse the repository at this point in the history
This commit retires old device hider logic based
on wiping PDOs from BusRelations array.

Previous commits introduce new logic based on IDs
patching.

Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Dmitry Fleytman committed Jun 29, 2016
1 parent a9bbb92 commit 0b7487b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
35 changes: 0 additions & 35 deletions UsbDk/FilterDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ NTSTATUS CUsbDkHubFilterStrategy::PNPPreProcess(PIRP Irp)

DropRemovedDevices(Relations);
AddNewDevices(Relations);
WipeHiddenDevices(Relations);
TraceEvents(TRACE_LEVEL_ERROR, TRACE_FILTERDEVICE, "%!FUNC! Finished relations array processing");
});
}
Expand Down Expand Up @@ -304,40 +303,6 @@ void CUsbDkHubFilterStrategy::AddNewDevices(const CDeviceRelations &Relations)
[this](PDEVICE_OBJECT PDO){ RegisterNewChild(PDO); return true; });
}

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::RegisterNewChild(PDEVICE_OBJECT PDO)
{
CWdmUsbDeviceAccess pdoAccess(PDO);
Expand Down
16 changes: 0 additions & 16 deletions UsbDk/FilterDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ class CUsbDkChildDevice : public CAllocatable<NonPagedPool, 'DCHR'>
, m_PDO(PDO)
{}

~CUsbDkChildDevice()
{
if (!m_Indicated)
{
ObDereferenceObject(m_PDO);
}
}

ULONG ParentID() const;
PCWCHAR DeviceID() const { return *m_DeviceID->begin(); }
PCWCHAR InstanceID() const { return *m_InstanceID->begin(); }
Expand Down Expand Up @@ -108,12 +100,6 @@ class CUsbDkChildDevice : public CAllocatable<NonPagedPool, 'DCHR'>

void Dump();

void MarkAsIndicated()
{ m_Indicated = true; }

bool IsIndicated() const
{ return m_Indicated; }

private:
CObjHolder<CRegText> m_DeviceID;
CObjHolder<CRegText> m_InstanceID;
Expand All @@ -124,7 +110,6 @@ class CUsbDkChildDevice : public CAllocatable<NonPagedPool, 'DCHR'>
PDEVICE_OBJECT m_PDO;
const CUsbDkFilterDevice &m_ParentDevice;
bool m_Redirected = false;
bool m_Indicated = false;

bool CreateRedirectorDevice();

Expand All @@ -149,7 +134,6 @@ class CUsbDkHubFilterStrategy : public CUsbDkFilterStrategy
private:
void DropRemovedDevices(const CDeviceRelations &Relations);
void AddNewDevices(const CDeviceRelations &Relations);
void WipeHiddenDevices(CDeviceRelations &Relations);
void RegisterNewChild(PDEVICE_OBJECT PDO);
void ApplyRedirectionPolicy(CUsbDkChildDevice &Device);
bool FetchConfigurationDescriptors(CWdmUsbDeviceAccess &devAccess,
Expand Down

0 comments on commit 0b7487b

Please sign in to comment.