Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to accept remote named pipe connections #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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

Expand Down