UsbDk: Introduce class describing redirection entity
CUsbDkRedirection class introduced Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit is contained in:
parent
3d4b8eda14
commit
bfa21156bb
2 changed files with 51 additions and 0 deletions
|
|
@ -300,3 +300,33 @@ bool CUsbDkControlDevice::Allocate()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
NTSTATUS CUsbDkRedirection::Create(const USB_DK_DEVICE_ID &Id)
|
||||
{
|
||||
auto status = m_DeviceID.Create(Id.DeviceID);
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
return m_InstanceID.Create(Id.InstanceID);
|
||||
}
|
||||
|
||||
void CUsbDkRedirection::Dump() const
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_CONTROLDEVICE,
|
||||
"%!FUNC! Redirect: DevID: %wZ, InstanceID: %wZ",
|
||||
m_DeviceID, m_InstanceID);
|
||||
}
|
||||
|
||||
bool CUsbDkRedirection::operator==(const USB_DK_DEVICE_ID &Id)
|
||||
{
|
||||
return (m_DeviceID == Id.DeviceID) &&
|
||||
(m_InstanceID == Id.InstanceID);
|
||||
}
|
||||
|
||||
bool CUsbDkRedirection::operator==(const CUsbDkRedirection &Other)
|
||||
{
|
||||
return (m_DeviceID == Other.m_DeviceID) &&
|
||||
(m_InstanceID == Other.m_InstanceID);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,27 @@ private:
|
|||
CUsbDkControlDeviceQueue& operator= (const CUsbDkControlDeviceQueue&) = delete;
|
||||
};
|
||||
|
||||
class CUsbDkRedirection : public CAllocatable<NonPagedPool, 'NRHR'>
|
||||
{
|
||||
public:
|
||||
NTSTATUS Create(const USB_DK_DEVICE_ID &Id);
|
||||
|
||||
bool operator==(const USB_DK_DEVICE_ID &Id);
|
||||
bool operator==(const CUsbDkRedirection &Other);
|
||||
|
||||
PLIST_ENTRY GetListEntry()
|
||||
{ return &m_ListEntry; }
|
||||
static CUsbDkRedirection *GetByListEntry(PLIST_ENTRY entry)
|
||||
{ return static_cast<CUsbDkRedirection*>(CONTAINING_RECORD(entry, CUsbDkRedirection, m_ListEntry)); }
|
||||
|
||||
void Dump() const;
|
||||
private:
|
||||
CString m_DeviceID;
|
||||
CString m_InstanceID;
|
||||
|
||||
LIST_ENTRY m_ListEntry;
|
||||
};
|
||||
|
||||
class CUsbDkControlDevice : private CWdfControlDevice, public CAllocatable<NonPagedPool, 'DCHR'>
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue