
UsbTreeView V2.0.2 - Shows the USB Device Tree
Freeware by Uwe Sieber - www.uwe-sieber.de

Works under Window 2000, XP, and higher

Usage:
UsbTreeView

(no parameters so far)


UsbTreeView is based upon the USBView sample found in the Windows Driver Kit for Server 2003.

Improvements:
- better icons in the treeview
- refresh on device change performed asynchronously
- shows additional information gathered from the Windows device management
- shows drive letter and mountpoints for USB mass storage devices
- can perform safe removal, device restart and port restart
- custom font and color for the right pane


History
V1.1   first published version
V1.2   works with Windows 2000 again
V1.3   shows some more information about USB 3.0 devices
V1.3.1 minor fixes
V1.3.2 workaround for TI root hubs
V1.4.0 device safe removal and restart, saves window position
V1.4.1 shows driver version and date, custom font and color for the right pane,
       removed some redundant information
V1.4.2 keeps tree item selection over refresh
V1.5.0 More USB information
       Extended USB information available under Windows 8 
       Rearranged the text output
       Some minor improvements
V2.0.0 USB enumeration rewritten; faster and independent from the treeview
       Port restart
       Extended host controller information
       Some failed USB requests are re-tried in the background, e.g. for
       mouses nearly flicker free refresh and resize
       many minor improvements
V2.0.1 Bugfix: Crash on complex descriptors
V2.0.2 Bugfix: Multiple volumes per disk not shown correctly
       Bugfix: String descriptors which are referenced more than ones was
       shown multiple times each


ToDo:
- Maybe USB Video Class information


About "Safe Removal" and "Restart"

On Safe Removal UsbTreeView first calls the configuration management call
CM_Query_And_Remove_SubTree. On success the device has the problem code
21 which is CM_PROB_WILL_BE_REMOVED. A code 21 device can be reactivated
by performing a DIF_PROPERTYCHANGE class installer call.
But CM_Query_And_Remove_SubTree needs admin previleges, otherwise it fails
with CR_ACCESS_DENIED. In this case CM_Request_Device_Eject is called
which works without admin previleges but leads to problem code 47 which
is CM_PROB_HELD_FOR_EJECT. Such a device cannot be reactivated alone.
A reactivation is possible by restarting the port or the whole hub it is
attached to or. But the latter of course restarts all devices attached to
the hub.

In all cases UsbTreeView just performs the system call and shows a message-box
if Windows returns an error. But Windows does not always return an error, even
there was one, so sometimes nothing happens at all.


About "Restart Port"

This calls IOCTL_USB_HUB_CYCLE_PORT which simulates a disconnect and
reconnect of the attached device.
It is available under XP but usually only for hubs which run with the
Microsoft default driver. 3rd party drivers usually return ERROR_UNKNOWN_FUNCTION.
Unter Vista and Windows 7 it is no more supported. With the Windows 8
Consumer Preview it works again as under XP.


About the Debug-Port

In Microsoft's USBView sample there is a list of USB host controllers
and their debug port. I've put the table into UsbTreeView.
Windows 8 has extended USB information, it reports for each port if it
is debug capable. On all my test computers it always reports "no", even
the list says that Port 1 or 2 are debug capable. It's not a fault of the
tool, it is was Windows 8 reports.


USB Mouses

If an USB mouse is moved while the tool requests its USB properties there
is usually an error becaue the mouse just has more important things to
do. UsbTreeView tries the for some seconds to get this information.
You might see the yellow question mark at your mouse for a moment which
disappears as soon as you stop moving the mouse.





Uwe Sieber
07 August 2012

