Querying the current state of a serviceΒΆ

query_service_status()

Querying the current state of a service


SYNTAX

query_service_status(service_handle, record_id)

Queries the current state of the specified service.

service_handle

A handle obtained by create_service() or open_service().

record_id

A Sculptor !record structure that defines the required information fields. Fields must be named exactly as listed below. It is only necessary to define the fields whose values are required:

ServiceType,,i4
CurrentState,,i4
ControlsAccepted,,i4
Win32ExitCode,,i4
ServiceSpecificExitCode,,i4
CheckPoint,,i4
WaitHint,,i4
ProcessID,,i4
ServiceFlags,,i4

The function returns 0 if successful, in which case the service status information has been stored in the supplied fields. See the Windows API for details of the values stored in these fields.

Returns a non-zero value if an error occurs. The Windows error code is stored in sys.Errno.

The query_service_config() function queries the configuration of a service.


RELATED TOPICS

Servers

Windows service management functions