How to find USB device Type?

I have an USB wireless mouse and a Digitizer. I attached these devices through a 4 port usb hub.

When I run usbview sample, it is displaying the connected device name as “USB Human Interface Device” for both devices.

I want to modify usbview sample to display the exact device name.

Can I use HardwareID registry property to distinguish between each connected device category?

or Is there any IOCTL or SetupDi API?

Thanks in Advance,
Raj.

If you use a REG_SZ with FriendlyName you can change what is displayed in
Device Manager. If the FriendyName Name does not exist Device Manger uses
the DeviceDesc. You can change the FriendlyName.

Note it you start regedit and search on USB Root Hub you will find one in
the …\Enum\USB\ROOT_HUB. You will have to change the permissions to be any
to write or create the FriendlyName REG_SZ. I created one called USB Hub
FriendlyName. I think went back into Device Manager and there it was. USB
Hub FriendlyName.

Note: You can SetupDiSetDeviceRegistryProperty() to do in a program. Their
is an good article on this titled “Device Installation Rules and Guidelines
for Windows Vista”.

I hope this helps some.

-William Michael Jones

wrote in message news:xxxxx@ntdev…
>
> I have an USB wireless mouse and a Digitizer. I attached these devices
> through a 4 port usb hub.
>
> When I run usbview sample, it is displaying the connected device name as
> “USB Human Interface Device” for both devices.
>
> I want to modify usbview sample to display the exact device name.
>
> Can I use HardwareID registry property to distinguish between each
> connected device category?
>
> or Is there any IOCTL or SetupDi API?
>
> Thanks in Advance,
> Raj.
>
>

Please don’t manually change the ACLs on the regkey, just use the proper
API mentioned below to do it for you.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of William Michael
Jones
Sent: Thursday, September 07, 2006 6:47 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to find USB device Type?

If you use a REG_SZ with FriendlyName you can change what is displayed
in
Device Manager. If the FriendyName Name does not exist Device Manger
uses
the DeviceDesc. You can change the FriendlyName.

Note it you start regedit and search on USB Root Hub you will find one
in
the …\Enum\USB\ROOT_HUB. You will have to change the permissions to be
any
to write or create the FriendlyName REG_SZ. I created one called USB
Hub
FriendlyName. I think went back into Device Manager and there it was.
USB
Hub FriendlyName.

Note: You can SetupDiSetDeviceRegistryProperty() to do in a program.
Their
is an good article on this titled “Device Installation Rules and
Guidelines
for Windows Vista”.

I hope this helps some.

-William Michael Jones

wrote in message news:xxxxx@ntdev…
>
> I have an USB wireless mouse and a Digitizer. I attached these devices

> through a 4 port usb hub.
>
> When I run usbview sample, it is displaying the connected device name
as
> “USB Human Interface Device” for both devices.
>
> I want to modify usbview sample to display the exact device name.
>
> Can I use HardwareID registry property to distinguish between each
> connected device category?
>
> or Is there any IOCTL or SetupDi API?
>
> Thanks in Advance,
> Raj.
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Thanks for your reply. But changing registry key will not work out here.
What I understand is, usbhub driver is creating a device object for each connected device through root hub or generic hub.

But the DEVICE_OBJECT’s DEVICE_TYPE is always FILE_DEVICE_UNKNOWN. I want to know for which physical device (mouse/Digitizer/keyboard) the \Device\USBPDO-x object has created. In another words, I would like to map to DDK’s DEVICE_TYPE values.

So How can I do this? I have tested several SetupDI apis. But I couldn’t get the device type.

So Let me know the API/IOCTL.

Regards,
Raj.

The usbhub doesn’t know what type of device it is. The PDOs will always
be FILE_DEVICE_UNKNOWN. Using the DDK device types as a correlation to
device function will not work.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Thursday, September 07, 2006 6:47 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to find USB device Type?

Thanks for your reply. But changing registry key will not work out here.
What I understand is, usbhub driver is creating a device object for each
connected device through root hub or generic hub.

But the DEVICE_OBJECT’s DEVICE_TYPE is always FILE_DEVICE_UNKNOWN. I
want to know for which physical device (mouse/Digitizer/keyboard) the
\Device\USBPDO-x object has created. In another words, I would like to
map to DDK’s DEVICE_TYPE values.

So How can I do this? I have tested several SetupDI apis. But I couldn’t
get the device type.

So Let me know the API/IOCTL.

Regards,
Raj.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

> But the DEVICE_OBJECT’s DEVICE_TYPE is always FILE_DEVICE_UNKNOWN. I

want to know for which physical device (mouse/Digitizer/keyboard) the
\Device\USBPDO-x object has created. In another words, I would like to
map to DDK’s DEVICE_TYPE values.

So How can I do this? I have tested several SetupDI apis. But
I couldn’t
get the device type.

You can use “DeviceIoControl” with
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION to get the Device Descriptor
and Interface Descriptors. The discriptors have 2 fields called
bDeviceClass, bDeviceSubClass and bInterfaceProtocol which specifies the USB
Device Class and type. For more information see the USB 2.0 documentation,
section “9.2.3 Configuration”.

Mouse: bDeviceClass = 3 (HID Class); bDeviceSubClass = 1; bInterfaceProtocol
= 2;
Keyboard: bDeviceClass = 3 (HID Class); bDeviceSubClass = 1;
bInterfaceProtocol = 1;

You might get more specific device information from DeviceClass dependent
sescriptors.
http://www.usb.org/developers/devclass_docs


Christoph Lindemann
Undocumented Printing
http://undocprint.printassociates.com/