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 service configuration program can use the EnumServicesStatusEx 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.