![]() |
|
|
#1 |
|
Guest
Posts: n/a
|
How to detect USB speed support by OS
Hi all,
I want to write a user mode program to check if OS support High-speed or not. Have any system function or hint can use to do this ? Thanks for help ! SL. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
Do you want to detect whether your pc is equiped with an high-speed
EHCI host controller, or do you want to detect whether the installed OS has a EHCI driver ? In the former case, have a look at usbuser.h in the DDK. There's a define USB_PACKETFLAG_HIGH_SPEED that you can check for. You can also walk the device tree and check check for PCI IDs and/or PCI class for EHCI. In the latter case, check the OS version, or look for the presence of usbehci.sys in the drivers directory. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
Correction for former case: check the USB_CONTROLLER_FLAVOR enum in the
USB_CONTROLLER_INFO_0 structure to detect EHCI controllers. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
RE: How to detect USB speed support by OS
"SL" wrote:
> Hi all, > > I want to write a user mode program to check if OS support High-speed or > not. > Have any system function or hint can use to do this ? Try the following vbscript. Basically it looks for "enhanced" in the name of usb host controller. -------------- On Error Resume Next nUSB2ctrls = 0 Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Wscript.Echo "(Enumerating USB controllers...)" Set colItems = objWMIService.ExecQuery("Select * from Win32_USBController") For Each objItem in colItems if CInt(objItem.ConfigManagerErrorCode) <> 0 then Wscript.Echo "*** This device has a problem or is disabled!" Wscript.Echo "Configuration Manager Error Code: " & objItem.ConfigManagerErrorCode end if Wscript.Echo "Name: " & objItem.Name Wscript.Echo "Manufacturer: " & objItem.Manufacturer Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID if 0 <> InStr(1, CStr(objItem.Name), "enhanced", 1) then Wscript.Echo "*** This is USB 2.0 controller" nUSB2ctrls = nUSB2ctrls + 1 end if Next if nUSB2ctrls <> 0 then Wscript.Echo "Number of USB 2.0 controllers found " & CStr(nUSB2ctrls) else Wscript.Echo "USB 2.0 controllers NOT found" end if ------------- |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
Hi Vetzak,
Can I say that OS didn't support high-speed mode if I can not find "usbhub20.sys" in drivers directory ? (OS must support high-speed if we can find "usbhub20.sys" ?) Is it work on all Windows version (98/ME/2000/XP) ? Or have any function can be use without DDK? Thanks for your help. SL. |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
Thank you Pavel, but I need writing in C/C++ language for some reason
![]() SL. |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
"SL" wrote:
> Thank you Pavel, but I need writing in C/C++ language for some reason ![]() Please... just rewrite the WMI calls in c++... --PA |
|
|
|
#8 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
There are also third-party drivers for EHCI controllers around. I think
looking at a filename isn't a good solution after all. I think it's better to detect PCI IDs. |
|
|
|
#9 |
|
Guest
Posts: n/a
|
Re: How to detect USB speed support by OS
"Pavel A." <pavel_a@NOwritemeNO.com> wrote in message
news:CF34813F-27FB-4E9A-AD82-295329AE3368@microsoft.com... > Try the following vbscript. Basically it looks for "enhanced" in the name > of usb host controller. It does indeed. But suppose the original poster might need a script that detects an enhanced usb host controller, instead of detecting English-language Windows? |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|