File:  [WindowsNT SDKs] / mstools / samples / service / readme.txt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:23:54 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-nov-1993, ntsdk-jul-1993, HEAD
Microsoft Windows NT Build 511 (SDK Final Release) 07-24-1993

Sample: Simple Service

Summary:

The Simple Service sample demonstrates how to create and
install a service.

In this particular case, the service merely opens a named
pipe of the name \\.\pipe\simple, and waits for traffic.
If it receives anything, it surrounds the input with:

        Hello! [<input goes here>]

and sends it back down the pipe to the client.

The service can be Started, Stopped, Paused, and Continued.

To install the service, first compile everything, and then
user INSTSRV to install SimpleService as follows:

        instsrv SimpleService <location of simple.exe>

Now all you have to do is start it, either using the
"net start" method or via the control panel Services applet.

Once the service has been started, you can use the CLIENT
program to verify that it really is working, using the syntax:

        client \\.\pipe\simple Hello

which should return the response:

        Hello! [Hello]

If, after playing with the sample you wish to remove the service,
simple say:

        instsrv SimpleService remove

Note that INSTSRV can be a little dangerous -- it'll install
and remove any service you tell it to, so be careful.


Additional reference words:

CloseServiceHandle, InitializeSecurityDescriptor,
SetSecurityDescriptorDacl, SetServiceStatus, OpenSCManager,
StartServiceCtrlDispatcher, RegisterEventSource,
DeregisterEventSource, RegisterServiceCtrlHandler

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.