UsbDk: Introduce UsbDeviceIsHub helper
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit is contained in:
parent
527a0b774f
commit
267311dcfe
2 changed files with 16 additions and 0 deletions
|
|
@ -249,6 +249,20 @@ NTSTATUS CWdmUsbDeviceAccess::GetConfigurationDescriptor(UCHAR Index, USB_CONFIG
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool UsbDkWdmUsbDeviceIsHub(PDEVICE_OBJECT PDO)
|
||||
{
|
||||
CWdmUsbDeviceAccess pdoAccess(PDO);
|
||||
|
||||
USB_DEVICE_DESCRIPTOR DevDescr;
|
||||
if (!NT_SUCCESS(pdoAccess.GetDeviceDescriptor(DevDescr)))
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVACCESS, "%!FUNC! Cannot query device descriptor");
|
||||
return false;
|
||||
}
|
||||
|
||||
return (DevDescr.bDeviceClass == USB_DEVICE_CLASS_HUB);
|
||||
}
|
||||
|
||||
bool UsbDkGetWdmDeviceIdentity(const PDEVICE_OBJECT PDO,
|
||||
CObjHolder<CRegText> *DeviceID,
|
||||
CObjHolder<CRegText> *InstanceID)
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ bool UsbDkGetWdmDeviceIdentity(const PDEVICE_OBJECT PDO,
|
|||
CObjHolder<CRegText> *DeviceID,
|
||||
CObjHolder<CRegText> *InstanceID = nullptr);
|
||||
|
||||
bool UsbDkWdmUsbDeviceIsHub(PDEVICE_OBJECT PDO);
|
||||
|
||||
template <typename TBuffer>
|
||||
void UsbDkBuildDescriptorRequest(URB &Urb, UCHAR Type, UCHAR Index, TBuffer &Buffer, ULONG BufferLength = sizeof(TBuffer))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue