Skip to content

Commit 5eea2f6

Browse files
committed
Add documentation
1 parent a4b8c5b commit 5eea2f6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

windows/svc/mgr/service.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ func (s *Service) Start(args ...string) error {
4545
return windows.StartService(s.Handle, uint32(len(args)), p)
4646
}
4747

48-
// Control sends state change request c to the service s.
48+
// Control sends state change request c to the service s. It returns the most
49+
// recent status the service reported to the service control manager, and an
50+
// error if the state change request was not accepted.
51+
// Note that the service status is only returned if the status change request
52+
// succeeded, or if it failed with error ERROR_INVALID_SERVICE_CONTROL,
53+
// ERROR_SERVICE_CANNOT_ACCEPT_CTRL, or ERROR_SERVICE_NOT_ACTIVE.
4954
func (s *Service) Control(c svc.Cmd) (svc.Status, error) {
5055
var t windows.SERVICE_STATUS
5156
err := windows.ControlService(s.Handle, uint32(c), &t)

0 commit comments

Comments
 (0)