c# - CallNamedPipe & NamedPipeServerStream, access denied? -


I'm trying to do the IPC between a managed and unmanaged process. I have settled on designated pipes.

I'm spinning a thread in managed code:

  using (NamedPipeServerStream stream = new Nampeepsserwarth stream ( "Maipip" PipeDirection.In)) {while (True) {stream.WaitForConnection (); Stream Reader (buffer, 0, size); // handle the buffer values}}  

I have been using the unmanaged side:

  CallNamedPipe (TEXT ( "\\\\. \\ "pipe fails with \\ Maipip"), nULL, 0, Peedata, Detasijh, tap, Anmpiwaiwaitiawaiaaitiafariaaraf);  

However, the GetLastError the CallNamedPipe 5 (Access denied). no Why even consider?

I would guess that since you are in the process under two different accounts You Namespipstream Using the Constructor, which uses default protection, the other user does not have access to it, it can be resolved by using Constructor which takes a PipeSecurity Instance. Then just tell other account access clearly.

edit: I noticed that you made as a one-way pipe towards the pipe. but I believe that the call-Anadpip able to both Efforts to open, read and write and will fail when connecting with one-way pipe.

EDIT 2: In addition, the constructor creates a byte type pipe, and CallNamedPipe only by message type pipe Can be connected. So you have to use another manufacturer.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -