locked
Is there any way to know whether driver is available for some usb device? RRS feed

  • Question

  • When a usb device is plugged in, the device manager will know if there is avaible driver for it or not and if there is problem with the driver for the device and will pop up the balloon tip to let user click to install driver.

    And in the device manager, I can see lots of IDs of the device in the details tab of the device property sheet, such as device instance id, hardware id, compatible id, matching device id etc. Obviously, if there is no matching device id, it means no availabe driver for the device. So I think the matching device id is a good sign to judge the driver's availability.

    For device instance id, hardware id and compatible id, the SetupApi can get them. Such as SetupDiGetDeviceInstanceId, SetupDiGetDeviceRegistryProperty. Then how can I get the matching device id?

    Any help will be appreciated.
    Thank you.

    Wednesday, August 24, 2011 8:46 AM

Answers

  • get the status of the devnode.  If it is ?'ed or !'ed out, you will get the appropriate status (ie it is not in the started state). no need to infer state based on matching ID
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Hendy.So Tuesday, August 30, 2011 12:56 AM
    Thursday, August 25, 2011 5:10 AM

All replies

  • The general rule here is the sources to DevCon are your friend.  While it does not have this particular capability, it can show you how to walk the Setup API's

     


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr
    Wednesday, August 24, 2011 10:27 AM
  • To know about the driver's availability I think SetupDiGetDeviceRegistryProperty with SPDRP_INSTALL_STATE flag against property should provide you the information. Not sure about the matching device ID
    Wednesday, August 24, 2011 10:54 AM
  • i think your test can be more basic than that.  if the device is not !'ed out, ie it doesn't have a problem code associated with it, that means that there was a matching driver and it has started successfully.  what is the ultimate problem you are trying to solve?
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, August 24, 2011 4:57 PM
  • Thanks for your reply.

    OK, here is my situation. I am working on an android phone management software. In order to control the phone, usb driver is needed. The drivers are provided by the vendors. So before I can access the phone, I have to check if the driver is installed. And I found that even sometimes driver is installed, the driver may still be unavailable. In the device manager, we can see a question mark over the device, and no matching device id in the property sheet. So I wonder if only I can get the matching device id I can know whether the driver is available or not.

    Any suggestions? Thanks.

     

    Thursday, August 25, 2011 3:48 AM
  • get the status of the devnode.  If it is ?'ed or !'ed out, you will get the appropriate status (ie it is not in the started state). no need to infer state based on matching ID
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Hendy.So Tuesday, August 30, 2011 12:56 AM
    Thursday, August 25, 2011 5:10 AM
  • Thank your very much. That's definitely what I want. I will try this method and give my feedback.
    • Proposed as answer by markRoddy Friday, August 26, 2011 3:44 PM
    Thursday, August 25, 2011 12:47 PM