Search code examples
c++windowswindows-services

passing a HANDLE to pipe from windows service to a user application


I am writing a windows service which will communicate to a user level application. Windows service will run on user machine for 24/7, whenever a user launches a corresponding application, it will establish connection to service using a named-pipe. But here service is responsible for creating client-side named-pipe as well. All works well on server side, but I do not understand how to send the Handle created by service to the client process through SCM?


Solution

  • You can't send the HANDLE over any IPC mechanism. The best I can think of would be to pass the name of the named pipe (perhaps in a command line argument to the second program), and have the second program re-open that pipe. That's the main purpose of the name.