winpipe: use x/sys/windows instead of syscall

This commit is contained in:
Jason A. Donenfeld
2019-09-16 23:39:16 -06:00
parent 70f6c42556
commit 01f8ef4e84
7 changed files with 128 additions and 229 deletions

View File

@ -8,6 +8,8 @@ package ipc
import (
"net"
"golang.org/x/sys/windows"
"golang.zx2c4.com/wireguard/ipc/winpipe"
)
@ -47,8 +49,16 @@ func (l *UAPIListener) Addr() net.Addr {
return l.listener.Addr()
}
/* SDDL_DEVOBJ_SYS_ALL from the WDK */
var UAPISecurityDescriptor = "O:SYD:P(A;;GA;;;SY)"
var UAPISecurityDescriptor *windows.SECURITY_DESCRIPTOR
func init() {
var err error
/* SDDL_DEVOBJ_SYS_ALL from the WDK */
UAPISecurityDescriptor, err = windows.SecurityDescriptorFromString("O:SYD:P(A;;GA;;;SY)")
if err != nil {
panic(err)
}
}
func UAPIListen(name string) (net.Listener, error) {
config := winpipe.PipeConfig{