|
|
1.1 root 1: Sample: Simple Service
2:
3: Summary:
4:
5: The Simple Service sample demonstrates how to create and
6: install a service.
7:
8: In this particular case, the service merely opens a named
9: pipe of the name \\.\pipe\simple, and waits for traffic.
10: If it receives anything, it surrounds the input with:
11:
12: Hello! [<input goes here>]
13:
14: and sends it back down the pipe to the client.
15:
16: The service can be Started, Stopped, Paused, and Continued.
17:
18: To install the service, first compile everything, and then
19: user INSTSRV to install SimpleService as follows:
20:
21: instsrv SimpleService <location of simple.exe>
22:
23: Now all you have to do is start it, either using the
24: "net start" method or via the control panel Services applet.
25:
26: Once the service has been started, you can use the CLIENT
27: program to verify that it really is working, using the syntax:
28:
29: client \\.\pipe\simple Hello
30:
31: which should return the response:
32:
33: Hello! [Hello]
34:
35: If, after playing with the sample you wish to remove the service,
36: simple say:
37:
38: instsrv SimpleService remove
39:
40: Note that INSTSRV can be a little dangerous -- it'll install
41: and remove any service you tell it to, so be careful.
42:
43:
44: Additional reference words:
45:
46: CloseServiceHandle, InitializeSecurityDescriptor,
47: SetSecurityDescriptorDacl, SetServiceStatus, OpenSCManager,
48: StartServiceCtrlDispatcher, RegisterEventSource,
49: DeregisterEventSource, RegisterServiceCtrlHandler
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.