github.com/zhongdalu/gf@v1.0.0/third/golang.org/x/sys/windows/svc/sys_386.s (about)

     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.
     4  
     5  // +build windows
     6  
     7  // func servicemain(argc uint32, argv **uint16)
     8  TEXT ·servicemain(SB),7,$0
     9  	MOVL	argc+0(FP), AX
    10  	MOVL	AX, ·sArgc(SB)
    11  	MOVL	argv+4(FP), AX
    12  	MOVL	AX, ·sArgv(SB)
    13  
    14  	PUSHL	BP
    15  	PUSHL	BX
    16  	PUSHL	SI
    17  	PUSHL	DI
    18  
    19  	SUBL	$12, SP
    20  
    21  	MOVL	·sName(SB), AX
    22  	MOVL	AX, (SP)
    23  	MOVL	$·servicectlhandler(SB), AX
    24  	MOVL	AX, 4(SP)
    25  	MOVL	$0, 8(SP)
    26  	MOVL	·cRegisterServiceCtrlHandlerExW(SB), AX
    27  	MOVL	SP, BP
    28  	CALL	AX
    29  	MOVL	BP, SP
    30  	CMPL	AX, $0
    31  	JE	exit
    32  	MOVL	AX, ·ssHandle(SB)
    33  
    34  	MOVL	·goWaitsH(SB), AX
    35  	MOVL	AX, (SP)
    36  	MOVL	·cSetEvent(SB), AX
    37  	MOVL	SP, BP
    38  	CALL	AX
    39  	MOVL	BP, SP
    40  
    41  	MOVL	·cWaitsH(SB), AX
    42  	MOVL	AX, (SP)
    43  	MOVL	$-1, AX
    44  	MOVL	AX, 4(SP)
    45  	MOVL	·cWaitForSingleObject(SB), AX
    46  	MOVL	SP, BP
    47  	CALL	AX
    48  	MOVL	BP, SP
    49  
    50  exit:
    51  	ADDL	$12, SP
    52  
    53  	POPL	DI
    54  	POPL	SI
    55  	POPL	BX
    56  	POPL	BP
    57  
    58  	MOVL	0(SP), CX
    59  	ADDL	$12, SP
    60  	JMP	CX
    61  
    62  // I do not know why, but this seems to be the only way to call
    63  // ctlHandlerProc on Windows 7.
    64  
    65  // func servicectlhandler(ctl uint32, evtype uint32, evdata uintptr, context uintptr) uintptr {
    66  TEXT ·servicectlhandler(SB),7,$0
    67  	MOVL	·ctlHandlerExProc(SB), CX
    68  	JMP	CX