From 1cf98a04b27e96b60432e415f4c476db5cc568d5 Mon Sep 17 00:00:00 2001 From: nnam Date: Wed, 28 Feb 2018 14:05:39 -0800 Subject: [PATCH] Add option to accept remote named pipe connections --- pipe.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pipe.go b/pipe.go index 82cbe7af..0ab456a1 100644 --- a/pipe.go +++ b/pipe.go @@ -31,6 +31,7 @@ const ( cSECURITY_SQOS_PRESENT = 0x100000 cSECURITY_ANONYMOUS = 0 + cPIPE_ACCEPT_REMOTE_CLIENTS = 0x0 cPIPE_REJECT_REMOTE_CLIENTS = 0x8 cPIPE_UNLIMITED_INSTANCES = 255 @@ -223,6 +224,9 @@ func makeServerPipeHandle(path string, securityDescriptor []byte, c *PipeConfig, } var mode uint32 = cPIPE_REJECT_REMOTE_CLIENTS + if c.RemoteClientMode { + mode = cPIPE_ACCEPT_REMOTE_CLIENTS + } if c.MessageMode { mode |= cPIPE_TYPE_MESSAGE } @@ -327,6 +331,9 @@ type PipeConfig struct { // when the pipe is in message mode. MessageMode bool + // RemoteClientMode determines whether the pipe can be accessed remotely. + RemoteClientMode bool + // InputBufferSize specifies the size the input buffer, in bytes. InputBufferSize int32