aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/uapi_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-09-16 23:39:16 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-09-16 23:39:16 -0600
commit01f8ef4e84a0354d33c32130f11c88d37d5f514d (patch)
tree62c251433f8a4e3a163821d6a442a3549d67ee38 /ipc/uapi_windows.go
parentwintun: use correct length for security attributes (diff)
downloadwireguard-go-01f8ef4e84a0354d33c32130f11c88d37d5f514d.tar.xz
wireguard-go-01f8ef4e84a0354d33c32130f11c88d37d5f514d.zip
winpipe: use x/sys/windows instead of syscall
Diffstat (limited to 'ipc/uapi_windows.go')
-rw-r--r--ipc/uapi_windows.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/ipc/uapi_windows.go b/ipc/uapi_windows.go
index 784b2a8..ead0dc5 100644
--- a/ipc/uapi_windows.go
+++ b/ipc/uapi_windows.go
@@ -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{