Service Control Manager

An integral part of Windows NT is the Service Control Manager (SCM). All Windows NT services must be registered with the SCM, which is responsible for starting and stopping the service process. When a process registers with the SCM, it provides attributes about the service, including:

  • The username that runs the process. This may not be the same as the user currently logged in to the system; indeed, there may not be anyone logged on to the system when the service starts.

  • Any other services that this service depends on. For example, if you were writing a Microsoft Exchange extension, you may specify your service is dependent on the Microsoft Exchange Information Store service. The SCM ensures that all dependent services are running before your service can start. It also ensures that when a service is stopped, all services that depend on it are also stopped.

  • How the service is to start: automatically when the system boots (and all dependants have also started), or manually (i.e., when initiated by the user).

The SCM provides a user interface that allows the user to manually control services. This user interface is available from the Services applet in the control panel.

The SCM also provides an API to allow programmatic control of services. Thus it is possible for a program to control services.

Get Python Programming On Win32 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.