aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/manager/install.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-06 18:39:07 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-08 22:21:05 +0200
commitffd492c9bddb3e41dc2e43399bbfa469740e9311 (patch)
tree6491c3cde347d6ea6aab75737d6450bd6e0d3e3f /manager/install.go
parentmain: update usage info (diff)
downloadwireguard-windows-ffd492c9bddb3e41dc2e43399bbfa469740e9311.tar.xz
wireguard-windows-ffd492c9bddb3e41dc2e43399bbfa469740e9311.zip
manager: set sidtype using upstream method
Diffstat (limited to '')
-rw-r--r--manager/install.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/manager/install.go b/manager/install.go
index 076f33b3..69a9ad3c 100644
--- a/manager/install.go
+++ b/manager/install.go
@@ -9,7 +9,6 @@ import (
"errors"
"os"
"time"
- "unsafe"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc"
@@ -161,19 +160,12 @@ func InstallTunnel(configPath string) error {
ErrorControl: mgr.ErrorNormal,
Dependencies: []string{"Nsi"},
DisplayName: "WireGuard Tunnel: " + name,
+ SidType: windows.SERVICE_SID_TYPE_UNRESTRICTED,
}
-
service, err = m.CreateService(serviceName, path, config, "/tunnelservice", configPath)
if err != nil {
return err
}
- sidType := uint32(windows.SERVICE_SID_TYPE_UNRESTRICTED)
- err = windows.ChangeServiceConfig2(service.Handle, windows.SERVICE_CONFIG_SERVICE_SID_INFO, (*byte)(unsafe.Pointer(&sidType)))
- if err != nil {
- service.Delete()
- service.Close()
- return err
- }
err = service.Start()
go trackTunnelService(name, service) // Pass off reference to handle.