locked
Confusion regarding Windows.Devices.Usb

    Question

  • Hi,

    Can someone please explain the usage of the Windows.Devices.Usb namespace? There are the following 2 contradictory statements on MSDN

    1. The introductory statement says

    Windows Runtime in Windows 8.1 provides a new namespace: Windows.Devices.Usb. By using the namespace, you can write a Windows Store app that talks to a custom USB device. "Custom" in this context means, a peripheral device for which Microsoft does not provide an in-box class driver.

    2. In the same article, the following is stated,

    You can use Windows.Devices.Usb, if...

    • The device driver is the Microsoft-provided Winusb.sys driver. The namespace does not support vendor-supplied device drivers.

    Reading these 2 statements I am thoroughly confused. Any clarification will help.

    Thanks,

    rumDeep

    Friday, April 18, 2014 3:39 AM

Answers

  • Winusb.sys isn't a class driver. It is the generic USB driver for devices which don't have specific class drivers.

    You can ignore the first paragraph if it confuses you and just read the explanatory paragraphs starting with Use the namespace... and Do not use the namespace...

    The former use winusb.sys which provides generic support for USB devices. The latter have class drivers which provide specific support for HID, Printers, etc.

    --Rob

      
    Friday, April 18, 2014 2:33 PM
    Owner

All replies

  • How are those statements contradictory?

    The first statement gives a high level overview. The second section gives more details.

    See the USB devices documentation for details:

    You can use Windows.Devices.Usb with devices which use the winusb.sys driver and the listed USB device class, subclass, and protocol codes.

    You cannot use Windows.Devices.Usb with devices which require custom drivers or with devices for which Windows provides more specific class drivers (e.g. Audio, HID, Image, etc. as listed at USB devices )and for which more specific classes are provided.

    --Rob

    Friday, April 18, 2014 7:21 AM
    Owner
  • Hi Rob,

    How can the statements not be contradictory?

    The first one says, "write a Windows Store app that talks to a custom USB device. "Custom" in this context means, a peripheral device for which Microsoft does not provide an in-box class driver. "

    And the second states, "The device driver is the Microsoft-provided Winusb.sys driver."

    As I understand the first statement states, use the class to talk to a device which doesn't have an in-box class driver. And if I am not wrong "Winusb.sys" is an in-box/ system driver. Please correct me if I am wrong.

    In the same documentation it is stated, "As they make new  peripherals, manufacturers can provide their own custom driver or use Winusb.sys."

    Regards,

    rumDeep

    Friday, April 18, 2014 8:33 AM
  • Winusb.sys isn't a class driver. It is the generic USB driver for devices which don't have specific class drivers.

    You can ignore the first paragraph if it confuses you and just read the explanatory paragraphs starting with Use the namespace... and Do not use the namespace...

    The former use winusb.sys which provides generic support for USB devices. The latter have class drivers which provide specific support for HID, Printers, etc.

    --Rob

      
    Friday, April 18, 2014 2:33 PM
    Owner