views:

133

answers:

2

Hello, I have created a program that write video stream to a named pipe on windows, using Visual Studio C++ 2008 . how to be sequre that no one exept programms on this computer can acsess this pipe?

  npipe = CreateNamedPipe("\\\\.\\pipe\\TestChannel", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_WAIT,  PIPE_UNLIMITED_INSTANCES , 1024, 1024,5000,NULL);
+2  A: 

Look at the CreateNamedPipe documentation on MSDN. The last parameter is an optional parameter for Security Options. With that you can specify what users access your pipe. That is the parameter you pass NULL into.

Romain Hippeau
+2  A: 

As of Windows Vista, you can include the PIPE_REJECT_REMOTE_CLIENTS flag in the dwPipeMode parameter. For earlier Windows versions, the documentation suggests using the lpSecurityAttributes parameter to deny access to the network.

Rob Kennedy