locked
Win32 service on Windows RT

    Question

  • We currently have below stack which runs on Windows7, Windows 8

      • USB / SPI device
      • Winusb drivers are installed for usb device and our SPI driver for SPI device
      • Win32 Service makes use of winusb/SPI driver IOCTLs to talk to device and exposes interfaces to applications
      • Applications make use of our service 

    We are looking to support this on Windows RT and have below questions

    1. Is winusb present on Windows RT?
    2. We have to write a SPI Peripheral driver (SPB framework). Till we get a Windows RT platform, can we try the same on a x86 platform with SPB framework. How different is SPB framework on Windows RT compared to Windows 8?
    3. Will our win32 service run on Windows RT?
    4. Do Existing applications which use Win32 API will run on Windows RT (I have seen some posts saying no and some says a subset of win32 APIs exist for Windows RT)?
    5. What is the best way to check this compatibility?

    Thanks

    Tuesday, September 04, 2012 7:28 AM

Answers

  • Hi Vikranth,

    Currently, the most detailed information about Windows RT is still the Building Windows 8 Blog post "Building Windows for the ARM Processor Architecture".  The excerpts from this article should answer your questions:

    "Metro style apps in the Windows Store can support both WOA and Windows 8 on x86/64. Developers wishing to target WOA do so by writing applications for the WinRT (Windows APIs for building Metro style apps) using the new Visual Studio 11 tools in a variety of languages, including C#/VB/XAML and Jscript/ HTML5. Native code targeting WinRT is also supported using C and C++, which can be targeted across architectures and distributed through the Windows Store. WOA does not support running, emulating, or porting existing x86/64 desktop apps. Code that uses only system or OS services from WinRT can be used within an app and distributed through the Windows Store for both WOA and x86/64. Consumers obtain all software, including device drivers, through the Windows Store and Microsoft Update or Windows Update."

    and

    "As we announced and demonstrated at //build/ and other forums, WOA has all the WinRT capabilities present in the Windows Developer Preview, and all the tools and techniques that you can use to build new Metro style apps for x86/64 are available to developers to also target WOA. Developers can use our tools to create native C/C++ code for maximal performance and flexibility, in addition to the C#, XAML, VB, and HTML5 based tools, to target apps for WOA, so long as their code targets the WinRT API set. Additionally, developers with existing code, whether in C, C++, C#, Visual Basic, or JavaScript, are free to incorporate that code into their apps, so long as it targets the WinRT API set for Windows services."

    In the last sentence, "WinRT API set for Windows services", refers not to Win32 service processes but to system services/capabilities exposed through the WinRT API set.  There are no WinRT API functions for writing Win32 service processes.

    Sincerely,

    Dan Ruder, Microsoft

    Tuesday, September 04, 2012 9:04 PM
    Moderator
  • Hi Viranth,

    To answer your two questions:

    1. WinUSB is not callable from Windows Store apps (apps that are written to the WinRT API and published through the Windows Store) because the APIs exist in WINAPI_PARTITION_DESKTOP (see winapifamily.h for details) and there is no WinRT wrapper class.  Briefly speaking, the app and desktop API partitions divide the Win32 APIs into those that are safe (and will pass Windows Store app certification) to use in Windows Store apps and those that are not.

    Regarding desktop applications, when you use Visual Studio 2012 RTM (which you can get from the MSDN subscriber downloads) to build a Win32 app (say a simple console "hello, world" app) and set the target CPU to ARM in the Build Configuration Manager, you will get the following build error:

       "error MSB8022:  Compiling Desktop applications for the ARM platform is not supported." 

    If you use the command-line tools (use C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat) to compile the same console app for ARM processors, you will get the following compiler error:

       "fatal error C1189: #error :  Compiling Desktop applications for the ARM platform is not supported."

    Therefore, WinUSB APIs would not be accessible to any applications you write for Windows RT.

    2. The Windows Driver Kit Version 8 (for Windows 8) supports writing drivers for x86 and X64 processors, but not ARM processors.

    The primary focus for app development for Windows RT will be Windows Store apps (that use the WinRT API) rather than desktop apps or drivers.  Windows Store apps can leverage sensors and other devices for which there are built in class drivers exposed through the WinRT APIs.

    Sincerely,

    Dan Ruder, Microsoft


    Wednesday, September 05, 2012 9:59 PM
    Moderator

All replies

  • Hi Vikranth,

    Currently, the most detailed information about Windows RT is still the Building Windows 8 Blog post "Building Windows for the ARM Processor Architecture".  The excerpts from this article should answer your questions:

    "Metro style apps in the Windows Store can support both WOA and Windows 8 on x86/64. Developers wishing to target WOA do so by writing applications for the WinRT (Windows APIs for building Metro style apps) using the new Visual Studio 11 tools in a variety of languages, including C#/VB/XAML and Jscript/ HTML5. Native code targeting WinRT is also supported using C and C++, which can be targeted across architectures and distributed through the Windows Store. WOA does not support running, emulating, or porting existing x86/64 desktop apps. Code that uses only system or OS services from WinRT can be used within an app and distributed through the Windows Store for both WOA and x86/64. Consumers obtain all software, including device drivers, through the Windows Store and Microsoft Update or Windows Update."

    and

    "As we announced and demonstrated at //build/ and other forums, WOA has all the WinRT capabilities present in the Windows Developer Preview, and all the tools and techniques that you can use to build new Metro style apps for x86/64 are available to developers to also target WOA. Developers can use our tools to create native C/C++ code for maximal performance and flexibility, in addition to the C#, XAML, VB, and HTML5 based tools, to target apps for WOA, so long as their code targets the WinRT API set. Additionally, developers with existing code, whether in C, C++, C#, Visual Basic, or JavaScript, are free to incorporate that code into their apps, so long as it targets the WinRT API set for Windows services."

    In the last sentence, "WinRT API set for Windows services", refers not to Win32 service processes but to system services/capabilities exposed through the WinRT API set.  There are no WinRT API functions for writing Win32 service processes.

    Sincerely,

    Dan Ruder, Microsoft

    Tuesday, September 04, 2012 9:04 PM
    Moderator
  • Thanks Dan.  Can you please answer to

    1. Is winusb present on Windows RT?
    2. We have to write a SPI Peripheral driver (SPB framework). Till we get a Windows RT platform, can we try the same on a x86 platform with SPB framework. How different is SPB framework on Windows RT compared to Windows 8?

    Thanks,

    Vikranth

    Wednesday, September 05, 2012 4:40 AM
  • Hi Viranth,

    To answer your two questions:

    1. WinUSB is not callable from Windows Store apps (apps that are written to the WinRT API and published through the Windows Store) because the APIs exist in WINAPI_PARTITION_DESKTOP (see winapifamily.h for details) and there is no WinRT wrapper class.  Briefly speaking, the app and desktop API partitions divide the Win32 APIs into those that are safe (and will pass Windows Store app certification) to use in Windows Store apps and those that are not.

    Regarding desktop applications, when you use Visual Studio 2012 RTM (which you can get from the MSDN subscriber downloads) to build a Win32 app (say a simple console "hello, world" app) and set the target CPU to ARM in the Build Configuration Manager, you will get the following build error:

       "error MSB8022:  Compiling Desktop applications for the ARM platform is not supported." 

    If you use the command-line tools (use C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat) to compile the same console app for ARM processors, you will get the following compiler error:

       "fatal error C1189: #error :  Compiling Desktop applications for the ARM platform is not supported."

    Therefore, WinUSB APIs would not be accessible to any applications you write for Windows RT.

    2. The Windows Driver Kit Version 8 (for Windows 8) supports writing drivers for x86 and X64 processors, but not ARM processors.

    The primary focus for app development for Windows RT will be Windows Store apps (that use the WinRT API) rather than desktop apps or drivers.  Windows Store apps can leverage sensors and other devices for which there are built in class drivers exposed through the WinRT APIs.

    Sincerely,

    Dan Ruder, Microsoft


    Wednesday, September 05, 2012 9:59 PM
    Moderator
  • Thanks Dan
    Thursday, September 06, 2012 1:50 AM