Feb. 28, 2007, 12:47 p.m.
posted by fractal
Architecture of Windows ServicesAs shown in Figure, the Windows services architecture has five main components:
1. The Service Control Manager provides a unified way to control, configure, and access Windows services.
The following sections discuss each of these components. Windows Service DatabaseThe Windows service database stores information about all the installed services. This database is a part of the Windows Registry and is stored in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services key. The Windows service database typically contains the following information for each Windows service:
Even though you can directly manipulate the Windows service database by modifying the Windows Registry using the regedit command or through a program, it is not recommended that you do so. To ensure the integrity of the database, you should always manipulate the Windows service database through the interfaces that the SCM provides. Service Control Manager (SCM)SCM is a Windows component that maintains the Windows service database and provides a unified way to control, configure, and access these services. The SCM performs the following tasks:
Windows provides a generic interface to work with the SCM through the Services and Computer Management MMC (Microsoft Management Console) snap-ins. These MMC snap-ins can be accessed through the Administrative tool section of the Windows Control Panel. Some applications, such as IIS and SQL Server, provide their own MMC snap-ins to control and configure their services. Windows Service InstallerA Windows service installer uses the SCM to install, uninstall, and repair a Windows service. The install, uninstall, and repair actions respectively create, delete, and update a Windows service record in the Windows service database. While installing a service, the Windows service installer also stores information about how the service will be started. This information includes
Windows Services in ExecutionJust installing a service in the Windows service database is not sufficient to enable you to use the service's functionality. By default, a Windows service must be explicitly started. However, it is also possible to set up a service in such a way that the service is started automatically with Windows. When the SCM starts a service, it attempts to create a Windows process for that service based on the information stored in the Windows service database. The SCM also sends a Start message to the service; this message invokes an associated handler in the service (if any) that specifies the processing to be done. After a Windows service is started, it continues to run until it receives a pause message or a stop message. When a Windows service is paused, the process for the Windows service continues to exist, but the service does not listen to the requests from the client programs. On the other hand, when a Windows service is stopped, its process is terminated and the memory is reclaimed. Windows Service Controller ProgramThe Windows service controller program uses the SCM to perform the following tasks:
You may question the need for the Windows service controller program when the Services MMC snap-in is already available to perform various control and administrative tasks for a Windows service. Although the Services MMC snap-in provides generic control and configuration options for Windows services, it cannot take care of the individual configuration requirements and customized user interface for each Windows service. For example, IIS provides an Internet Information Services snap-in in the MMC to provide a customized interface to administer the World Wide Web Publishing, the File Transfer Protocol (FTP) Publishing, Network News Transfer Protocol (NNTP), and the Simple Mail Transfer Protocol (SMTP) services.
|
- Comment
