. Home Feedback Contents Search

Service 

Init
Installation
Run
Uninstallation

Back Up Next

Services are really pretty darned easy to make but the details of what goes where and why can be a bit, to paraphrase a rather well known politician, confusicating.

Services are non-windowed programs that operate on the system's authentication, not a users. When the machine starts, services start. The reason why a service has to run under system credentials rather than user credentials is that a service is designed to run whether or not a user is logged on.

There are some non-obvious ramifications to the account authentication type. Services typically have an awful lot of control over the local machine and not much anywhere else. They have to borrow user credentials in order to gain network access, for example.

The Service Control Manager (SCM - pronounced 'scum' as in 'of the earth') is in charge of services. It will load up a registered service and start it, depending upon how the service has registered itself. The manner in which the service receives communiqués from the SCM is defined. The manner in which a service talks to its clients is left entirely up to the imagination of the programmer. A typical means to communicate is through a COM interface or a named pipe. There are limits, of course. For example, contrary to what you may hear from other sources, sticky notes have proven to leave something to be desired.

In short, a normal service is a console window application with defined entry points that SCM can get to that runs when Windows starts. There is no reason why a service has to be a straight Win32 application. It can be an MFC.

Back Up Next