Using IOCTL_USB_HCD_GET_STATS_1

I would like to use IOCTL_USB_HCD_GET_STATS_1 to query the number of CRC errors
on our USB devices : we have customers who insist on buying cheap 5m cables to connect
our devices, and a bus analyzer shows it is not a good idea. We need a way to warn them they may lose packets or lower the bandwidth.

I have tried modifying usbview, but I get Error 1 (Invalid Function).

Could it be I am not sending the IOCTL to the right handle ?
Does this error mean it is not accessible in user mode ?
Can I call it from kernel mode from our HID minidriver ? (and how)

The doc says it is not available in Vista. Is there an alternative on Vista ?
Could this information be accessed via performance counters ?

Thanks,

Pierre

It looks like IOCTL_USB_HCD_GET_STATS_1 is not supported by usbport on any OS, not just vista. The only driver which appears to have supported this IOCTL is uhcd.sys (a usb1.1 driver). Vista does have a USB perf counter though (open perfmon and USB is a top level category) so you can capture the data you need via perfmon.msc

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@bleucanard.f2s.com
Sent: Friday, October 05, 2007 8:14 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Using IOCTL_USB_HCD_GET_STATS_1

I would like to use IOCTL_USB_HCD_GET_STATS_1 to query the number of CRC errors
on our USB devices : we have customers who insist on buying cheap 5m cables to connect
our devices, and a bus analyzer shows it is not a good idea. We need a way to warn them they may lose packets or lower the bandwidth.

I have tried modifying usbview, but I get Error 1 (Invalid Function).

Could it be I am not sending the IOCTL to the right handle ?
Does this error mean it is not accessible in user mode ?
Can I call it from kernel mode from our HID minidriver ? (and how)

The doc says it is not available in Vista. Is there an alternative on Vista ?
Could this information be accessed via performance counters ?

Thanks,

Pierre


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Doron, I will try this next week on Vista.

Pierre