locked
Has Windows.Devices.USB changed between 8.1 preview and the 8.1 RTM? RRS feed

  • Question

  • Hi,

    For a demo at a recent TechEd event I wrote an app that allowed Windows 8.1 to connect to an OWI 535 robotic arm using the generic WinUSB device driver. Since upgrading my machine to RTM this code no longer works, and the documentation on MSDN still reflects the preview APIS.

    I was wondering if there have been any breaking changes in the RTM release?

    Specifically the issues I am having are:

    1) the AQS query created by Windows.Devices.USB.USBDevice using a VID and PID is no longer returning a device. Yet if I enumerate all devices using Windows.Devices.Enumeration I can find my device attachted to the machine.

    2) Using the second method above to establish the device ID, I am not able to connect to the USBDevice, with the SUBDevice.FromIdAsync method returning null without any error.

    Can anyone help me with establishing changes or point me towards new API documentation?

    Thanks,
    Lewis


    Windows/Windows Phone Device & integration consultant | Follow Me on Twitter: @LewisBenge Or check out my blog: http://www.lewisbenge.net

    Wednesday, September 25, 2013 6:18 AM

Answers

  • Hi Lewis,

    A likely reason is that your device doesn't expose a WinUSB interface GUID. In Windows 8.1 RTM, devices that don't expose a WinUSB interface GUID cannot be opened using Windows.Devices.Usb (nor using WinUSB in a desktop application).

    Normally, a WinUSB device interface GUID is specified by either writing a driver INF that loads WinUSB and sets the GUID; or, creating a set Microsoft OS descriptors in the device's firmware to accomplish the same thing.

    An alternative for personal development and testing is to install WinUSB manually, in which case you must also set the DeviceInterfaceGUIDs registry value manually. To learn how to specify the WinUSB interface GUID in each of these ways, please see WinUSB (Winusb.sys) Installation on MSDN.

    In your nice blog post documenting your steps you mentioned this issue. Since your steps load WinUSB manually, you will probably want to set DeviceInterfaceGUIDs manually. See section "Installing WinUSB by specifying the system-provided device class" in the MSDN document linked above.

    • Proposed as answer by Philip Ries Wednesday, September 25, 2013 7:53 PM
    • Marked as answer by LewisBenge Wednesday, September 25, 2013 9:00 PM
    Wednesday, September 25, 2013 7:12 PM

All replies

  • Why was this moved from the hardware integration forum?

    Windows/Windows Phone Device & integration consultant | Follow Me on Twitter: @LewisBenge Or check out my blog: http://www.lewisbenge.net

    Wednesday, September 25, 2013 7:13 AM
  • Hi Lewis,

    A likely reason is that your device doesn't expose a WinUSB interface GUID. In Windows 8.1 RTM, devices that don't expose a WinUSB interface GUID cannot be opened using Windows.Devices.Usb (nor using WinUSB in a desktop application).

    Normally, a WinUSB device interface GUID is specified by either writing a driver INF that loads WinUSB and sets the GUID; or, creating a set Microsoft OS descriptors in the device's firmware to accomplish the same thing.

    An alternative for personal development and testing is to install WinUSB manually, in which case you must also set the DeviceInterfaceGUIDs registry value manually. To learn how to specify the WinUSB interface GUID in each of these ways, please see WinUSB (Winusb.sys) Installation on MSDN.

    In your nice blog post documenting your steps you mentioned this issue. Since your steps load WinUSB manually, you will probably want to set DeviceInterfaceGUIDs manually. See section "Installing WinUSB by specifying the system-provided device class" in the MSDN document linked above.

    • Proposed as answer by Philip Ries Wednesday, September 25, 2013 7:53 PM
    • Marked as answer by LewisBenge Wednesday, September 25, 2013 9:00 PM
    Wednesday, September 25, 2013 7:12 PM
  • Hi,

    Thanks for the reply.

    Two  questions:

    1) If I want to set the registry key, do you know where I set it? MSDN doesn't specify - would it be in HKLM\Drivers\DriverPackages ?

    2) If I write a custom unsigned INF file and install it using the Windows advanced boot menu, will this add the key for me instead?

    Thanks again,

    Lewis


    Windows/Windows Phone Device & integration consultant | Follow Me on Twitter: @LewisBenge Or check out my blog: http://www.lewisbenge.net

    Wednesday, September 25, 2013 9:00 PM
  • 1) The registry key is the device instance's hardware key. It will be a child of this one:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\<VID_vvvv&PID_pppp>

    2) Yes, the installation of the INF will add the necessary registry value in the right place as long as you are sure to include this line (with your own GUID) in the INF:

    HKR,,DeviceInterfaceGUIDs,0x10000,"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"

    Wednesday, September 25, 2013 9:07 PM
  • Thanks - the inf file was the easiest option using the template - and everything now works fine!

    I'll update my blog post to reflect the RTM change.


    Windows/Windows Phone Device & integration consultant | Follow Me on Twitter: @LewisBenge Or check out my blog: http://www.lewisbenge.net

    Wednesday, September 25, 2013 9:42 PM