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.

Re: How to detect USB speed support by OS by Vetzak

Vetzak
Mon Oct 17 03:36:18 CDT 2005

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.


Re: How to detect USB speed support by OS by Vetzak

Vetzak
Mon Oct 17 03:40:17 CDT 2005

Correction for former case: check the USB_CONTROLLER_FLAVOR enum in the
USB_CONTROLLER_INFO_0 structure to detect EHCI controllers.


RE: How to detect USB speed support by OS by pavel_a

pavel_a
Mon Oct 17 03:59:02 CDT 2005

"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

-------------




Re: How to detect USB speed support by OS by SL

SL
Mon Oct 17 04:31:50 CDT 2005

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.



Re: How to detect USB speed support by OS by SL

SL
Mon Oct 17 04:46:32 CDT 2005

Thank you Pavel, but I need writing in C/C++ language for some reason :)

SL.



Re: How to detect USB speed support by OS by pavel_a

pavel_a
Mon Oct 17 08:43:07 CDT 2005

"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

Re: How to detect USB speed support by OS by Vetzak

Vetzak
Mon Oct 17 09:52:37 CDT 2005

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.


Re: How to detect USB speed support by OS by Norman

Norman
Mon Oct 17 19:07:50 CDT 2005

"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?