CE 6.0 R3 FindFirstDevice() How To Build A USB 'Tree' RRS feed

  • Question

  • For sake of convenience we will say that I want to build a USB tree of all USB devices attached to my device (ATOM N270). Basically I want to 'port' the UsbView.exe example to my CE device. I want to know: the attached USB Devices, Which port they are on, Which HUB they are attached to (Possibly an external hub), Which RootHub they are attached to, and finally which Host Controller the Hub they are attached to is attached to. I would also like to be able to retrieve all of the information I can about the attached USB device (PID,VID,REV,.....).

    Under desktop operating system one starts from the HCD's and works their way up. I can use FindFirstDevice for HCD1-10 and get the HCD's. I can then do a CreateFile() on the DEVMGR_DEVICE_INFORMATION->szDeviceName (or ->szLegacyName it appears) and I get a valid  handle.  Under a desktop operating system I would normally DeviceIoControl(IOCTL_USB_GET_ROOT_HUB) but of course this does not seem to be valid for CE 6.0.

    Is there another way to accomplish what I am attempting under CE?

    I have been unable to make any headway with this. Most of my problem is that I do not have a solid understanding of CE drivers, and there seems to be very little documentation available on this topic.

    I have a suspicion that I will be told that I need to modify the HCD code. If this is true it is OK with me, I am not afraid to do so. I have seen referenced to 'implementing custom IOCTL's' but have been unable to find any information as to what that means.

    Any help or direction would be greatly appreciated.

    Saturday, April 19, 2014 6:41 PM


  • I am cleaning up my open posts.

    I ended up learning all about CE USB device drivers (specifically the UHCI and EHCI), modified the stacks on the 3 devices I needed to run on (via BSP / OsDesign) and implemented the IOCTL's available on Windows Desktop operating systems as 'Custom' IOCTL's. I can now compile my Windows Desktop application for CE 6.0 and WEC7 and runs with no code changes under these two operating systems (On my 3 devices of course). Yea!


    • Marked as answer by RSullivan59 Saturday, November 7, 2015 2:03 PM
    Saturday, November 7, 2015 2:03 PM