aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/uapi_windows.go
diff options
context:
space:
mode:
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{