Service Installation, Removal, and Enumeration

A configuration program uses the CreateService function to install a new service in the SCM database. This function specifies the name of the service and provides configuration information that is stored in the database. For a description of the information stored in the database for each service, see Database of Installed Services. For sample code, see Installing a Service.

A configuration program uses the DeleteService function to remove an installed service from the database. For more information, see Deleting a Service.

To obtain the service name, call the GetServiceKeyName function. The service display name, used in the Services control panel applet, can be obtained by calling the GetServiceDisplayName function.

A service configuration program can use the EnumServicesStatus function to enumerate all services and their statuses. It can also use the EnumDependentServices function to enumerate which services are dependent on a specified service object.