Documentation ¶
Index ¶
- Variables
- func DialPipe(path string, timeout *time.Duration) (net.Conn, error)
- func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error)
- func DialPipeContext(ctx context.Context, path string) (net.Conn, error)
- func ListenPipe(path string, c *PipeConfig) (net.Listener, error)
- func LookupNameBySid(sid string) (name string, err error)
- func LookupSidByName(name string) (sid string, err error)
- func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error)deprecated
- func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error)
- func SddlToSecurityDescriptor(sddl string) ([]byte, error)
- func SecurityDescriptorToSddl(sd []byte) (string, error)
- type AccountLookupError
- type PipeConfig
- type PipeConn
- type SddlConversionError
Constants ¶
This section is empty.
Variables ¶
var ( ErrFileClosed = errors.New("file has already been closed") ErrTimeout = &timeoutError{} )
var ( // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed. ErrPipeListenerClosed = net.ErrClosed )
Functions ¶
func DialPipe ¶
DialPipe connects to a named pipe by path, timing out if the connection takes longer than the specified duration. If timeout is nil, then we use a default timeout of 2 seconds. (We do not use WaitNamedPipe.)
func DialPipeAccess ¶
DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` cancellation or timeout.
func DialPipeContext ¶
DialPipeContext attempts to connect to a named pipe by `path` until `ctx` cancellation or timeout.
func ListenPipe ¶
func ListenPipe(path string, c *PipeConfig) (net.Listener, error)
ListenPipe creates a listener on a Windows named pipe path, e.g. \\.\pipe\mypipe. The pipe must not already exist.
func LookupNameBySid ¶
LookupNameBySid looks up the name of an account by SID
func LookupSidByName ¶
LookupSidByName looks up the SID of an account by name
func MakeOpenFile
deprecated
func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error)
Deprecated: use NewOpenFile instead.
func NewOpenFile ¶
func NewOpenFile(h windows.Handle) (io.ReadWriteCloser, error)
Types ¶
type AccountLookupError ¶
func (*AccountLookupError) Error ¶
func (e *AccountLookupError) Error() string
func (*AccountLookupError) Unwrap ¶
func (e *AccountLookupError) Unwrap() error
type PipeConfig ¶
type PipeConfig struct { // SDDL contains a Windows security descriptor in SDDL format. SDDL string // MessageMode determines whether the pipe is in byte or message mode. In either // case the pipe is read in byte mode by default. The only practical difference in // this implementation is that CloseWrite() is only supported for message mode pipes; // CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only // transferred to the reader (and returned as io.EOF in this implementation) // when the pipe is in message mode. MessageMode bool // InputBufferSize specifies the size of the input buffer, in bytes. InputBufferSize int32 // OutputBufferSize specifies the size of the output buffer, in bytes. OutputBufferSize int32 // QueueSize specifies the maximum number of concurrently active pipe server // handles to allow. This is conceptually similar to the `backlog` argument // to `listen(2)` on Unix systems. Increasing this value reduces the likelyhood // of a connecting client receiving a `windows.ERROR_PIPE_BUSY` error. // (Assuming that the server is written to call `l.Accept()` using a pool of // application worker threads.) // // This value should be larger than your expected client arrival rate so that // there are always a few extra listener worker threads and (more importantly) // unbound server pipes in the kernel, so that a client "CreateFile()" should // not get a busy signal. QueueSize int32 }
PipeConfig contain configuration for the pipe listener.
type SddlConversionError ¶
func (*SddlConversionError) Error ¶
func (e *SddlConversionError) Error() string
func (*SddlConversionError) Unwrap ¶
func (e *SddlConversionError) Unwrap() error