Managing Globally with Information Technology

Team-Fly    

Developing XML Web Services and Server Components with Visual C#™ .NET and the .NET Framework, Exam Cram™ 2 (Exam 70-320)

By Amit Kalani, Priti Kalani

Table of Contents
Chapter 7.  Windows Services

A Windows service is a process that conforms to the interface rules of the Windows Service Control Manager (SCM). The SCM is a part of the Windows operating system that provides a unified way to control, configure, and access Windows services.

Windows services are available on Windows NT (where they are known as NT services), Windows 2000, Windows XP, and Windows Server 2003 operating systems. There is no support of Windows services on the Windows 95, Windows 98, or Windows Me operating systems.

In general, a Windows service is a process that provides background services to other processes. Some typical examples of Windows services are World Wide Web Publishing, Print Spooler, Task Scheduler, Event Log, and Plug and Play. Some common characteristics of Windows services are listed here:

  • Conformance to SCM Each Windows service must implement a set of well-known methods, which enable the service to communicate with the SCM. Some common messages sent by the SCM to a service are Start, Pause, Continue, and Stop.

  • Lack of user interface Windows services perform system tasks that usually do not require any user interface. A Windows service might need to inform the user about an application state or an event in the environment. Most Windows services do so by writing informative messages in the event log.

  • Long-lived process Typically, a Windows service is started automatically when the computer is started and continues to live. Services can execute even when no user is logged on to the system. Most Windows services provide the functionality that enables them to be paused, resumed, started, or stopped.

  • Specific user identity Most Windows services run with System privileges. System is a special account that Windows uses to perform privileged operations. However, if a Windows service does not need all these privileges, you can restrict them by launching the Windows service with a specific user identity instead of the System account.

  • Separate Windows process A Windows service does not run in the process of the program that communicates with it. Instead, a Windows service runs in its own process. Sometimes a Windows service can also share a process with another Windows service.

  • Special installation procedure Unlike a Windows application, a Windows service cannot be started by just executing its .exe file. Instead, a Windows service requires a special installation procedure. This installation procedure registers the Windows service with the Windows Service Control Manager (SCM). The SCM enables you to control a Windows service; this includes operations such as starting, pausing, and stopping a service. The SCM also enables you to configure a Windows service; this includes operations such as setting up a service user account.


    Team-Fly    
    Top

    Категории