Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Моя Пояснительная записка.doc
Скачиваний:
3
Добавлен:
10.09.2019
Размер:
581.12 Кб
Скачать

55

Contents of the Report

Introduction 04

1. Problem statement 05

2. Algorithms of the service program 06

3. Algorithms of the service management program 10

4. Algorithm of the client program 15

5. Implementation of programs 17

6. Implementation of service program 18

7. Implementation of service management program 18

8. Implementation of client program 19

Conclusion 20

References 21

Appendix 1. Source code of the service program 22

Appendix 2. Source code of the service management program 31

Appendix 3. Source code of the client program 52

Introduction

System service in Windows NT systems – it is background process, witch can be executed and without any part from interactive user. In this meaning system services in Windows like daemons in UNIX and resident programs in Ms-Dos systems.

Typically, system services are started when system boots and continue their work, until system is not halted. But it is possible to pause or stop system service during work.

Common architecture of system services in Windows NT has 3 components like on figure 1.1. The core is Service Control Manager (SCM). SCM is started during loading of system and works until Windows NT shutdown. From one side, this manager interacts with control programs, form other side – interacts with system services. Main tasks of SCM are:

  1. Loading system services during Windows NT booting witch must be loaded automatically.

  2. Storing of configure data base, witch consists of records with information about all services.

  3. Transferring requests from control programs to system services.

Figure 1.1. Common architecture of system service

Windows NT defines 2 types of system services. One of them – kernel-mode services, which can be named “Device Drivers”. Second type – Win32 services – it is common Win32 – processes, which are using special set of functions to interact with system control manager.

Control programs – it is common Win32 – programs, which manipulate services using program interface via system control manager. Typical example of control program - is MMC snap-in services in Windows 2000/XP.

Problem Statement

Win32 services consist of three components: a service program, a service control program (SCP), and the service control manager (SCM).

Each Windows NT system has component called the Service Control Manager (SCM). This component is implemented in “services.exe”, and it is loaded when the operating system boots automatically. The SCM runs with system account “LocalSystem”. The SCM has opportunity to start, to stop, to pause or to continue work of service program.

A service control program (SCP) is an application with some user interface that allows to start, to stop, to pause or to continue main function of service via sending some signals to SCM. SCP calls special Windows functions, witch are implemented in ADVAPI32.DLL and in KERNEL32.DLL.

The Service Control Manager (SCM) works with data base of installed services and drivers, it provides a unified and secure means to control them. This database includes information about all services: how it will be started (manually, automatically etc), from what account to do start (“LocalSystem”, ”NetworkSystem”, any user account, etc), also it controls dependencies and recovery parameters.

Figure 1.1 shows how SCP, SCM and Service program communicates each with other. SCP application don’t communicate with service program directly, all communication goes through the SCM.

Figure 1.1. Communication between SCP, SCM and Service application