windows/svc: rewrite in Go

The old service management code was written in assembly and communicated
over Windows events, which resulted in non-obvious control flow.
NewCallback makes it possible to rewrite all of this in vanilla Go. This
also enables the service test on the Go builders, as modifying system
services shouldn't be an issue there.

Change-Id: I8003b57d11d4469f762058c648a4b7733530eeb8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/330010
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Jason A. Donenfeld
2021-10-20 06:40:51 +00:00
parent 9d821ace86
commit 0ec99a608a
12 changed files with 64 additions and 435 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ func stopAndDeleteIfInstalled(t *testing.T, m *mgr.Mgr, name string) {
}
func TestExample(t *testing.T) {
if testing.Short() {
if testing.Short() && os.Getenv("GO_BUILDER_NAME") != "" {
t.Skip("skipping test in short mode - it modifies system services")
}