feat: add native Windows hierarchy test harness
This commit is contained in:
@@ -74,8 +74,13 @@ func newTrayPipe() (*os.File, error) {
|
||||
Length: uint32(unsafe.Sizeof(winapi.SecurityAttributes{})),
|
||||
SecurityDescriptor: descriptor,
|
||||
}
|
||||
mode := uint32(winapi.PIPE_ACCESS_DUPLEX | winapi.PIPE_TYPE_MESSAGE | winapi.PIPE_READMODE_MESSAGE | winapi.PIPE_WAIT | winapi.PIPE_REJECT_REMOTE_CLIENTS | winapi.SECURITY_IDENTIFICATION)
|
||||
handle, err := winapi.CreateNamedPipe(name, mode, pipeInstances, pipeBufferBytes, pipeBufferBytes, 0, 0, attributes)
|
||||
// CreateNamedPipe has separate open-mode and pipe-mode arguments. Remote
|
||||
// client rejection belongs to the latter; placing it in open mode produces
|
||||
// ERROR_INVALID_PARAMETER on Windows. We inspect the client token directly
|
||||
// and never impersonate it, so no SQOS/impersonation flag is needed here.
|
||||
openMode := uint32(winapi.PIPE_ACCESS_DUPLEX)
|
||||
pipeMode := uint32(winapi.PIPE_TYPE_MESSAGE | winapi.PIPE_READMODE_MESSAGE | winapi.PIPE_WAIT | winapi.PIPE_REJECT_REMOTE_CLIENTS)
|
||||
handle, err := winapi.CreateNamedPipe(name, openMode, pipeMode, pipeInstances, pipeBufferBytes, pipeBufferBytes, 0, attributes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user