Opening a service for control purposesΒΆ

open_service()

Open a service for control purposes


SYNTAX

open_service(manager_handle, service_name, access_rights)

Opens a service for control purposes.

manager_handle

A handle obtained from a previous call to open_scmanager().

service_name

The name of the service.

access_rights

Desired access to the service. See the Windows API for full details. SC_MANAGER_ALL_ACCESS can be used if the user running the program has Administrator privileges.

If successful, the function returns a manager handle, which should be stored in an i8 field. It returns 0 if the service cannot be opened. The Windows error code is stored in sys.Errno.


RELATED TOPICS

Servers

Windows service management functions