本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
874B

  1. // Copyright 2018 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. // +build windows
  5. #include "textflag.h"
  6. // func servicemain(argc uint32, argv **uint16)
  7. TEXT ·servicemain(SB),NOSPLIT|NOFRAME,$0
  8. MOVM.DB.W [R4, R14], (R13) // push {r4, lr}
  9. MOVW R13, R4
  10. BIC $0x7, R13 // alignment for ABI
  11. MOVW R0, ·sArgc(SB)
  12. MOVW R1, ·sArgv(SB)
  13. MOVW ·sName(SB), R0
  14. MOVW ·ctlHandlerExProc(SB), R1
  15. MOVW $0, R2
  16. MOVW ·cRegisterServiceCtrlHandlerExW(SB), R3
  17. BL (R3)
  18. CMP $0, R0
  19. BEQ exit
  20. MOVW R0, ·ssHandle(SB)
  21. MOVW ·goWaitsH(SB), R0
  22. MOVW ·cSetEvent(SB), R1
  23. BL (R1)
  24. MOVW ·cWaitsH(SB), R0
  25. MOVW $-1, R1
  26. MOVW ·cWaitForSingleObject(SB), R2
  27. BL (R2)
  28. exit:
  29. MOVW R4, R13 // free extra stack space
  30. MOVM.IA.W (R13), [R4, R15] // pop {r4, pc}
上海开阖软件有限公司 沪ICP备12045867号-1