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 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
Post a Comment