locked
Is there any way to use WinUSB from a Metro app?

    Question

  • It looks like I can recode my current WinUSB driver along the lines of the osrusbfx2 sample.

     

    I was curious if there were any plans to add WinUSB support. WinUSB is built on top of UMDF so it would seem to be a natural fit for the Metro chain:

    UMDF --> DeviceIOControl --> WinRT C++ Custom Component --> Metro App.

    Thanks for considering this, and any additional custom device information that can be provided via the WinRT / Metro documentation.

    --Dan Edgar

    Monday, September 19, 2011 6:56 PM

Answers

  • You will need to create either a UMDF or KMDF driver for your device and provide your own IOCTL interface.  You can then access that from your WinRT C++ Custom Component.
    Wednesday, September 28, 2011 12:24 AM
  • DavidWin,

    This is not a supported scenario for Windows 8 Metro style device apps.

    Best Wishes - Eric

    Monday, June 11, 2012 3:11 PM
    Moderator
  • Windows RT products are delivered complete with firmware, drivers and accessories. Developer focus for Windows RT is Metro style apps, not desktop apps or drivers.  Metro style apps can leverage sensors and other devices for which there are built in class drivers exposed through the WinRT APIs.

    Friday, June 29, 2012 10:52 PM
    Moderator
  • Clarence,

    The information provided in this thread is the latest available.

    Best Wishes - Eric

    Saturday, June 30, 2012 4:50 AM
    Moderator

All replies

  • Hi Dan,

    I'm not sure exactly what you are asking here.  Can you elaborate?

    A properly manifested Metro component can call DeviceIOControl and should be able to interact with your device. 

    --Rob

    Tuesday, September 20, 2011 5:59 PM
    Moderator
  • Currently I use a WinUSB driver and the WinUSB API to communicate with my device. This is best explained by the WinUSB documentation.

    I don't use any DeviceIOControl APIs as I am using the WinUSB framework to create my driver.

    Can I use WinUSB from a Metro application?

    The alternative seems to be to abandon WinUSB and create a UMDF driver along the lines of the osrusbfx2 DDK sample.

     

    Tuesday, September 27, 2011 12:13 PM
  • You will need to create either a UMDF or KMDF driver for your device and provide your own IOCTL interface.  You can then access that from your WinRT C++ Custom Component.
    Wednesday, September 28, 2011 12:24 AM
  • Hmm, what are the outlooks for a "Metro-ified" WinUSB with proper async support etc?

    / David

    Monday, June 11, 2012 11:38 AM
  • DavidWin,

    This is not a supported scenario for Windows 8 Metro style device apps.

    Best Wishes - Eric

    Monday, June 11, 2012 3:11 PM
    Moderator
  • Can you please clarify whether a UMDF driver can use WinUSB on Win8/WinRT (x86/x64/ARM)?

    I have VS12, OS/WDK 8400.

    I created UMDF USB driver via Project template. I noticed it only has x86/x64 configurations for Win8, which build driver and package fine. I assume this means UMDF driver with WinUSB are supported on Win8/WinRT for x86/x64?

    But ARM is not included in configuration, so I add ARM. Driver compiles, but it fails building package:

    2>  Signability test failed.
    2>  
    2>  Errors:
    2>  22.9.1: wudfupdate_01011.dll in [coinstallers_copyfiles] of \usbdriver2.inf is missing or cannot be decompressed from source media.  Please verify all path values specified in SourceDisksNames, SouceDisksFiles, and CopyFiles sections resolve to the actual location of the file, and are expressed in terms relative to the location of the inf.
    2>  22.9.1: wdfcoinstaller01011.dll in [coinstallers_copyfiles] of \usbdriver2.inf is missing or cannot be decompressed from source media.  Please verify all path values specified in SourceDisksNames, SouceDisksFiles, and CopyFiles sections resolve to the actual location of the file, and are expressed in terms relative to the location of the inf.
    2>  22.9.1: winusbcoinstaller2.dll in [coinstallers_copyfiles] of \usbdriver2.inf is missing or cannot be decompressed from source media.  Please verify all path values specified in SourceDisksNames, SouceDisksFiles, and CopyFiles sections resolve to the actual location of the file, and are expressed in terms relative to the location of the inf.
    2>  
    2>  Warnings:
    2>  None
    2>ARM\Win8Debug\inf2catOutput.log : Inf2Cat error -2: "Inf2Cat, signability test failed." Double click to see the tool output.
    Does this mean it is not supported for ARM?

    BTW, the CustomDeviceAccess Metro app does compile for x86/x64/ARM. It references the umdf_fx2 driver (which has same issue as the UMDF USB driver template above for ARM).

    Thanks,

    Clarence


    Friday, June 22, 2012 6:38 PM
  • Is there official documentation on this restriction? 

    I assume then that the Win8 sample drivers I referenced (umdf_fx2 and UMDF USB project template) are intended for x86/x64 Win8 desktop app use only. Is that correct?

    My understanding is that ARM devices will not support Win8 desktop (only WinRT Metro apps). Thus, any solution using UMDF USB driver with WinUSB would not work on WinRT ARM. Correct?

    If so, what is recommended solution? Is there other mechanism for UMDF driver to communicate over USB not using WinUSB? Or must use KMDF driver for USB communication? 

    I have opened a case with MSFT explaining our situation, but have not received response. Is there anyway I can get direct support via email?

    Thanks,

    Clarence

    Friday, June 22, 2012 8:57 PM
  • Clarence,

    What bus does your device talk over and is it external / internal or both?

    Friday, June 22, 2012 9:13 PM
    Moderator
  • Eric,

    It is serial over usb and both internal and external.

    Thanks,

    Clarence

    Friday, June 22, 2012 9:18 PM
  • Eric,

    Regarding the Win8 ARM package failures, I noticed following documentation:

    http://msdn.microsoft.com/en-us/library/windows/hardware/ff544208(v=vs.85).aspx

    ----

    KMDF version 1.11 is included with Windows 8 Release Preview. If you are writing a driver that must work only on Windows 8, you do not need to include a co-installer, custom installer, or reference in the INF file, because the required framework version is already installed as part of the operating system. Otherwise, you may need to include the framework updates as part of your driver package.

    ----

    As expected, when I remove the CoInstallers_CopyFiles from the .inf file, it builds package fine. Regardless, we still have the policy issue you mentioned regarding not allowing UMDF driver to use WinUSB.

    Thanks,

    Clarence

    Friday, June 22, 2012 9:39 PM
  • Eric,

    Any updates to requests above? Most importantly, where is official documentation on WinRT driver policy with respect to WinUSB use in UMDF driver and if it is forbidden, what is recommended method of UMDF driver communication over USB (documentation and sample code) (It seems you are suggesting the only sample code available umdf_fx2 does not apply to WinRT) ?

    Thanks,

    Clarence

    Thursday, June 28, 2012 9:20 PM
  • Windows RT products are delivered complete with firmware, drivers and accessories. Developer focus for Windows RT is Metro style apps, not desktop apps or drivers.  Metro style apps can leverage sensors and other devices for which there are built in class drivers exposed through the WinRT APIs.

    Friday, June 29, 2012 10:52 PM
    Moderator
  • Thanks Eric. What about below session?

    Building Metro style apps that connect to specialized devices

    : http://channel9.msdn.com/events/BUILD/BUILD2011/HW-747T

    See slides 15/25. There is a partner supplied custom driver in the diagram.

    Saturday, June 30, 2012 12:04 AM
  • Clarence,

    The information provided in this thread is the latest available.

    Best Wishes - Eric

    Saturday, June 30, 2012 4:50 AM
    Moderator