1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // func servicemain(argc uint32, argv **uint16)
8 TEXT ·servicemain(SB),7,$0
12 SUBQ $32, SP // stack for the first 4 syscall params
15 MOVQ $·servicectlhandler(SB), DX
16 // BUG(pastarmovj): Figure out a way to pass in context in R8.
17 MOVQ ·cRegisterServiceCtrlHandlerExW(SB), AX
21 MOVQ AX, ·ssHandle(SB)
23 MOVQ ·goWaitsH(SB), CX
24 MOVQ ·cSetEvent(SB), AX
29 MOVQ ·cWaitForSingleObject(SB), AX
36 // I do not know why, but this seems to be the only way to call
37 // ctlHandlerProc on Windows 7.
39 // func ·servicectlhandler(ctl uint32, evtype uint32, evdata uintptr, context uintptr) uintptr {
40 TEXT ·servicectlhandler(SB),7,$0
41 MOVQ ·ctlHandlerExProc(SB), AX