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
10 ANDQ $~15, SP // alignment as per Windows requirement
11 SUBQ $48, SP // room for SP and 4 args as per Windows requirement
12 // plus one extra word to keep stack 16 bytes aligned
19 MOVQ $·servicectlhandler(SB), DX
20 // BUG(pastarmovj): Figure out a way to pass in context in R8.
21 // Set context to 123456 to test issue #25660.
23 MOVQ ·cRegisterServiceCtrlHandlerExW(SB), AX
27 MOVQ AX, ·ssHandle(SB)
29 MOVQ ·goWaitsH(SB), CX
30 MOVQ ·cSetEvent(SB), AX
35 MOVQ ·cWaitForSingleObject(SB), AX
42 // I do not know why, but this seems to be the only way to call
43 // ctlHandlerProc on Windows 7.
45 // func ·servicectlhandler(ctl uint32, evtype uint32, evdata uintptr, context uintptr) uintptr {
46 TEXT ·servicectlhandler(SB),7,$0
47 MOVQ ·ctlHandlerExProc(SB), AX