Service Functions

The following functions are used or implemented by services.

FunctionDescription
HandlerAn application-defined callback function used with the RegisterServiceCtrlHandler function.
HandlerExAn application-defined callback function used with the RegisterServiceCtrlHandlerEx function.
RegisterServiceCtrlHandlerRegisters a function to handle service control requests.
RegisterServiceCtrlHandlerExRegisters a function to handle extended service control requests.
ServiceMainAn application-defined function that serves as the starting point for a service.
SetServiceBitsRegisters a service type with the service control manager and the Server service.
SetServiceStatusUpdates the service control manager's status information for the calling service.
StartServiceCtrlDispatcherConnects the main thread of a service process to the service control manager.

 

The following functions are used by programs that control or configure services.

FunctionDescription
ChangeServiceConfigChanges the configuration parameters of a service.
ChangeServiceConfig2Changes the optional configuration parameters of a service.
CloseServiceHandleCloses the specified handle to a service control manager object or a service object.
ControlServiceSends a control code to a service.
ControlServiceExSends a control code to a service.
CreateServiceCreates a service object and adds it to the specified service control manager database.
DeleteServiceMarks the specified service for deletion from the service control manager database.
EnumDependentServicesRetrieves the name and status of each service that depends on the specified service.
EnumServicesStatusExEnumerates services in the specified service control manager database based on the specified information level.
GetServiceDisplayNameRetrieves the display name of the specified service.
GetServiceKeyNameRetrieves the service name of the specified service.
NotifyBootConfigStatusReports the boot status to the service control manager.
NotifyServiceStatusChangeEnables an application to receive notification when the specified service is created or deleted or when its status changes.
OpenSCManagerEstablishes a connection to the service control manager on the specified computer and opens the specified service control manager database.
OpenServiceOpens an existing service.
QueryServiceConfigRetrieves the configuration parameters of the specified service.
QueryServiceConfig2Retrieves the optional configuration parameters of the specified service.
QueryServiceObjectSecurityRetrieves a copy of the security descriptor associated with a service object.
QueryServiceStatusExRetrieves the current status of the specified service based on the specified information level.
SetServiceObjectSecuritySets the security descriptor of a service object.
StartServiceStarts a service.

 

Obsolete Functions

The following functions are obsolete.

EnumServicesStatus
LockServiceDatabase
QueryServiceLockStatus
QueryServiceStatus
UnlockServiceDatabase

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Page view tracker