TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

Notices

Reply
 
Thread Tools Display Modes
Old 29-11-2007, 05:53 PM   #1
SL
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.


  Reply With Quote
Old 29-11-2007, 05:53 PM   #2
Vetzak
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.

  Reply With Quote
Old 29-11-2007, 05:53 PM   #3
Vetzak
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.

  Reply With Quote
Old 29-11-2007, 05:53 PM   #4
Pavel A.
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

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



  Reply With Quote
Old 29-11-2007, 05:53 PM   #5
SL
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.


  Reply With Quote
Old 29-11-2007, 05:53 PM   #6
SL
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.


  Reply With Quote
Old 29-11-2007, 05:53 PM   #7
Pavel A.
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
  Reply With Quote
Old 29-11-2007, 05:53 PM   #8
Vetzak
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.

  Reply With Quote
Old 29-11-2007, 05:54 PM   #9
Norman Diamond
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?

  Reply With Quote
Reply

Thread Tools
Display Modes


Google
 


All times are GMT +5.5. The time now is 02:21 AM.


vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2008, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional