Skip to content

Commit

Permalink
Report superspeed properly on Win7
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ybendito authored and YanVugenfirer committed Oct 17, 2018
1 parent 960f44e commit 4d1ecea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions UsbDk/FilterDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 4d1ecea

Please sign in to comment.