The Windows Service Communication Architecture

[Previous] [Next]

Three types of components are involved in making services work:

  • Service Control Manager (SCM, pronounced scum) Each Windows 2000 system ships with a component called the Service Control Manager. This component lives in the Services.exe file; it is automatically invoked when the operating system boots, and terminates when the system is shut down. The SCM runs with system privileges and provides a unified and secure means of controlling service applications. The SCM is responsible for communicating with the various services, telling them to start, stop, pause, continue, and so on.
  • Service application A service is simply an application that contains the infrastructure necessary for communicating with the SCM, which sends commands to the service, telling it to start, stop, pause, continue, or shut down. A service also calls special functions that communicate its status back to the SCM.
  • Service Control Program (SCP) This is an application that usually presents a user interface that allows a user to start, stop, pause, continue, and otherwise control all the services installed on a machine. The service control program calls special Windows functions that let it talk to the SCM.

Figure 3-1 shows how all these components communicate with one another. Notice that SCP applications do not communicate with services directly; all communication goes through the SCM. This architecture is precisely what makes the remote administration transparent to the SCP and service applications. It is possible to implement an architecture and a protocol that enables your SCP application to talk directly with your service application, but you must write the communication code yourself.

click to view at full size.

Figure 3-1. Windows service communication architecture

Of these three components, you will never implement the SCM itself. Microsoft implements the SCM and packages it into every version of Windows 2000. What you will implement are services and SCPs. This chapter will cover what you need to know to design and implement a service, and the next chapter will cover the details of writing an SCP.



Programming Server-Side Applications for Microsoft Windows 2000
Programming Server-Side Applications for Microsoft Windows 2000 (Microsoft Programming)
ISBN: 0735607532
EAN: 2147483647
Year: 2000
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net