Sends a pause request to the specified service.

PauseService(cServiceName | nServiceHandle [, nTimeout [, cServer [, cDatabase]]])

Parameters

cServiceName | nServiceHandle

Either the name of the service or a numeric handle returned from the OpenService function.

nTimeout (optional)

Maximum time in seconds to wait while the service is in SERVICE_PAUSE_PENDING state.

If you pass 0 the function doesn't wait until the service is paused, instead it returns immediately after the pause request has been sent.

If you omit this parameter or pass NULL the timeout is set to the default timeout reported by the service.
See MSDN help for SERVICE_STATUS_PROCESS structure's "dwWaitHint" member.

cServer (optional)

The server name on which the service is running.
See MSDN help for OpenSCManager.

cDatabase (optional)

The database under which the service is registered.
See MSDN help for OpenSCManager.

Return Value

1 if the service was paused within the timeout period, 0 otherwise.

See Also

Reference

ADependentServices
AServiceConfig
AServices
AServiceStatus
CloseServiceHandle
ContinueService
ControlService
CreateService
OpenService
StartService
StopService
WaitForServiceStatus

Used WinApi functions

ControlService
OpenSCManager
OpenService
CloseServiceHandle