locked
CallNamedPipe fail in Metro App

    Question

  • I used [DllImport ("kernel32")] to import CallNamedPipe in my Metro Style App, and compile is no problem, but it always fail when running it. Actually the same code can work well on Win7 (.NET Framework).

    Does it mean CallNamedPipe is not support in Metro Style APP?

    Is there any other way to realize the same function as CallNamedPipe in Metro Style App?

    Appreciating any help.

    Thursday, May 10, 2012 7:56 AM

Answers

  • CallNamedPipe is desktop only:
    Applies to: desktop apps only

    See Win32 and COM for Metro style apps for a list of allowed Win32 API. The individual documentation entries should also say if specific apps apply to desktop apps or Metro style apps.

    Even if a function is allowed in a Metro style app, it is still subject to the security constraints of the application package. For example, an app can call the file API on files in its app package and app data directories, but it cannot use them to read files it doesn't have access to elsewhere in the file system.

    --Rob

    Thursday, May 10, 2012 7:17 PM
    Owner

All replies

  • CallNamedPipe is desktop only:
    Applies to: desktop apps only

    See Win32 and COM for Metro style apps for a list of allowed Win32 API. The individual documentation entries should also say if specific apps apply to desktop apps or Metro style apps.

    Even if a function is allowed in a Metro style app, it is still subject to the security constraints of the application package. For example, an app can call the file API on files in its app package and app data directories, but it cannot use them to read files it doesn't have access to elsewhere in the file system.

    --Rob

    Thursday, May 10, 2012 7:17 PM
    Owner
  • Thanks so much, Rob.

    My application situation is like this: another Win32 App creats a named pipe, and I want to setup message bridge between this Win32 app and Metro Style app,  what should I do to realize this message mechanism in Metro Style app?

    Also if using File API in Metro Style app, this file created exsit only in app package, we can not create it at desired location, right?

    Can I say: Metro Style app is independent app, it can not communicate with other apps, including data transfer, messgae post and so on?

    Friday, May 11, 2012 9:39 AM
  • Rob, Can I create one COM where I realize CallNamedPipe() and expose a pair functions: int readPipe() and writePipe(int), and last make it as reg-free COM. So that Metro Style app can in-directly call CallNamedPipe()?

    Thank you very much.

    Friday, May 11, 2012 9:46 AM
  • There are no supported means of IPC between Metro style apps and desktop apps. This is correct:

    Can I say: Metro Style app is independent app, it can not communicate with other apps, including data transfer, messgae post and so on?

    --Rob

    Friday, May 11, 2012 5:52 PM
    Owner
  • No. Everything in the app package (including the COM object) works within the constraints of Metro style apps. Even if you could call such functions, they would be blocked at the security barrier and couldn't communicate with processes outside of the app package.

    --Rob

    Friday, May 11, 2012 5:55 PM
    Owner