From 4d1ecea50dc99add7d0bc2ff4bb974403941c5e4 Mon Sep 17 00:00:00 2001 From: Yuri Benditovich Date: Wed, 17 Oct 2018 12:02:19 +0300 Subject: [PATCH] Report superspeed properly on Win7 Win7 with USB 3.0 stack might not report superspeed the same way as Win8 does. Use bcdUSB field of device descriptor for that (USB 3.0 device connected to USB 2.x port usually falls to USB 2 compatible configuration). Getting the speed from HUB driver via IOCTL is more complicated. Signed-off-by: Yuri Benditovich --- UsbDk/FilterDevice.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UsbDk/FilterDevice.cpp b/UsbDk/FilterDevice.cpp index 936db67..1a806a0 100644 --- a/UsbDk/FilterDevice.cpp +++ b/UsbDk/FilterDevice.cpp @@ -362,6 +362,15 @@ void CUsbDkHubFilterStrategy::RegisterNewChild(PDEVICE_OBJECT PDO) return; } +#if (NTDDI_VERSION == NTDDI_WIN7) + // recheck on Win7, superspeed indication as on Win8 might be not available + if (Speed == HighSpeed && DevDescriptor.bcdUSB >= 0x300) + { + TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_FILTERDEVICE, "%!FUNC! superspeed assigned according to BCD field"); + Speed = SuperSpeed; + } +#endif + CUsbDkChildDevice::TDescriptorsCache CfgDescriptors(DevDescriptor.bNumConfigurations); if (!CfgDescriptors.Create())