none
Why does SetupDiEnumDEviceInterface return zero (0)? RRS feed

  • Question

  •  

    I write an application based on WinUSB Template. The name of my application is "HelloUsbDevice". My computer is 32-bit computer and has Windows 7 Maximal OS. I debug my application in single computer setup. As specified at https://msdn.microsoft.com/en-us/library/windows/hardware/dn376872(v=vs.85).aspx I opened INF file from HelloUsbDevice Package project in my solution and located the line: %DeviceName% =USB_Install, USB\VID_vvvv&PID_pppp. Then I plug the flash drive to my computer and opened the Device Manager. In Device Manager I selected and opened "USB Controllers" item. There I selected "USB storage device" and opened its properties. On the Details tab, I copy the value of Hardware Ids property. THis value was "USB\VID_8564&PID_1000&REV_1100". I replaced VID_vvvv&PID_pppp with this value. And this line now is:

    [Standard.NT$ARCH$]
    %DeviceName% =USB_Install, USB\VID_8564&PID_1000&REV_1100

    Then I did all steps shown in https://msdn.microsoft.com/en-us/library/windows/hardware/dn376872(v=vs.85).aspx for single computer setup debug. But when I try manually to install the driver specified in the INF file from HelloUsbDevice Package then Windows rejected this driver and default USB driver was retained (C:\Windows\system32\drivers\USBSTOR.SYS). And now when I start my application then the call of SetupDiEnumDeviceInterface in RetriveDevicePath function returns HRESULT == 0. I mean that the reason is that  PSP_DEVICE_INTERFACE_DETAIL_DATA.InterfaceClassGuid.Data4 = MMMMMMMM in fifth argument of SetupDiEnumDeviceInterface. What I did wrong? Help me please.





    Tuesday, May 19, 2015 3:17 PM

Answers

  • pick another USB device that doesn't have an in box driver for it already. Unless you want to reimplement the entire usb mass storage spec in your application, installing winusb on a storage device doesn't make sense.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Purple_Apple Thursday, May 21, 2015 5:41 AM
    Wednesday, May 20, 2015 5:44 PM

All replies

  • But where this log file is?
    Tuesday, May 19, 2015 3:26 PM
  • Windows\inf\setupapi.dev.log ... if you are trying to use the winusb guid this failure is expected. The driver is not installed

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, May 19, 2015 5:23 PM
  • How can I install correct driver? When I try to install manually the driver specified in the INF file from HelloUsbDevice Package (this is Winusb.sys as I understand) then Windows rejected this driver and default USB driver (C:\Windows\system32\drivers\USBSTOR.SYS)  was retained. Can I use C:\Windows\system32\drivers\USBSTOR.SYS instead of Winusb.sys for the development of my application based on WinUSB Template?


    Wednesday, May 20, 2015 6:24 AM
  • pick another USB device that doesn't have an in box driver for it already. Unless you want to reimplement the entire usb mass storage spec in your application, installing winusb on a storage device doesn't make sense.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Purple_Apple Thursday, May 21, 2015 5:41 AM
    Wednesday, May 20, 2015 5:44 PM