locked
Windows desktop bridge with pipes and shared memory RRS feed

  • Question

  • Hi,

    After reading the submission guidelines for Windows desktop apps (https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-prepare) to the Windows Store I have two remaining questions:

    1. Is it possible to run a named pipe server in a sandboxed desktop app (the server should be accessible from other apps outside the sandbox)?
    2. Is it possible to use shared memory between a sandboxed desktop app and a normal app running outside of the sandbox?

    Regards,


    • Edited by SyFr Friday, June 12, 2020 7:52 AM
    Friday, June 12, 2020 7:52 AM

Answers

  • I submitted the test app to the Windows Store. The app installed from the Windows Store works exactly the same way. It seems that indeed desktop apps have full IPC/Pipe access.
    Monday, June 15, 2020 5:11 AM

All replies

  • Hi,

    Thanks for posting here.

    The 2 options are possible since they are not listed in the document.

    But need to pay attention:

    1. According to the CreateNamedPipeWindows 10, version 1709:  Pipes are only supported within an app-container; ie, from one UWP process to another UWP process that's part of the same app. Also, named pipes must use the syntax "\\.\pipe\LOCAL" for the pipe name.

        Another document:
    Your desktop app process can create a named pipe and allow access to your UWP app (Game Bar Widget). To allow access grant access to SECURITY_WORLD_SID_AUTHORITY as well as your desired SID (package SID or app capability SID). You can follow the Custom Capability RPC sample for how to construct a security identifier. Note that if you're using package SID, you don't need any of the logic used in the sample that converts the Custom Capability to its SID form. You'll just use the package SID directly.

    2. There is also a discussion on this issue here, pay attention to the accessibility of shared files

    Best Regards,

    Drake


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 15, 2020 2:49 AM
  • Thanks a lot for the two options. I tested a Win32 desktop application (no UWP code) which uses named pipes and shared memory. Therefore I created a Windows Store compatible app package as follows which also creates the app's AppxManifest.xml:

    DesktopAppConverter.exe ... -MakeAppx -Sign

    I then installed the app:

    Add-AppxPackage –Register AppxManifest.xml

    The desktop app installed this way works flawlessly. It can communicate via named pipes with other desktop apps. The shared memory created by this app can also be accessed by other desktop apps.


    Is it correct that desktop apps, even if packaged and shipped to the Windows Store, have full access (to pipes and shared memory) outside of their sandbox?







    • Edited by SyFr Monday, June 15, 2020 3:46 AM
    Monday, June 15, 2020 3:39 AM
  • I submitted the test app to the Windows Store. The app installed from the Windows Store works exactly the same way. It seems that indeed desktop apps have full IPC/Pipe access.
    Monday, June 15, 2020 5:11 AM