Introduction on Windows Services
The service control manager (SCM) maintains a database of installed services and driver services, and provides a unified and secure means of controlling them. The database includes information on how each service or driver service should be started. It also enables system administrators to customize security requirements for each service and thereby control access to the service. The following types of programs use the functions provided by the SCM.
Type |
Description |
Service program |
A program that provides executable code for one or more services. Service programs use functions that connect to the SCM and send status information to the SCM. |
Service configuration program |
A program that queries or modifies the services database. Service configuration programs use functions that open the database, install or delete services in the database, and query or modify the configuration and security parameters for installed services. Service configuration programs manage both services and driver services. |
Service control program |
A program that starts and controls services and driver services. Service control programs use functions that send requests to the SCM, which carries out the request. |
Service Control Manager
The service control manager (SCM) is started at system boot. It is a remote procedure call (RPC) server, so that service configuration and service control programs can manipulate services on remote machines. The service functions provide an interface for the following tasks performed by the SCM:
The following sections describe the SCM in more detail.
Database of Installed Services
The SCM maintains a database of installed services in the registry. The database is used by the SCM and programs that add, modify, or configure services. The following is the registry key for this database:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
This key contains a subkey for each installed service and driver service. The name of the subkey is the name of the service, as specified by the CreateService() function when the service was installed by a service configuration program. An initial copy of the database is created when the system is installed. The database contains entries for the device drivers required during system boot. The database includes the following information about each installed service and driver service:
This database is also known as the ServicesActive database or the SCM database. You must use the functions provided by the SCM, instead of modifying the database directly.