Home |  Page Index / Recent Changes / Access deniedRecently Commented | Search:
Login:     Password:   

  Bookmarks:   Page Index | Recent Changes | Access deniedRecently Commented | Access deniedUsers | Registration  
Print version :: Microsoft Word ready version

Sw4me: Winserv/Internals ...

If you want to write a winserv-based service in a scripting language other than TCL, you may want to implement helper modules, similar to TCL winserv support package. To do it, you have to know what escape sequences winserv interprets when the application writes to its standard output or the named pipe.

Each string that winserv will parse must be terminated by a newline. If you use escape sequences, you must put each sequence on a line by itself.

\033 aaccept/deny control codes:
\033 a paccept pause/continue control codes
\033 a caccept PARAMCHANGE
\033 a saccept SHUTDOWN
\033 a naccept NETBIND... codes
\033 a rreset; accept STOP and nothing more
\033 a P don't accept pause/continue
\033 a C don't accept PARAMCHANGE
\033 a S don't accept SHUTDOWN
\033 a N don't accept NETBIND... codes
\033 s set service status
\033 s p the service is now paused
\033 s Pthe service is going to pause (PAUSE_PENDING)
\033 s Cthe service is going to continue (CONTINUE_PENDING)
\033 s r the service is running
\033 s Sthe service is going to stop (STOP_PENDING)
\033 e add message to the event log:
\033 e i at the information level
\033 e e at the error level
\033 e s at the success level
\033 e w at the warning level
\033 e a at the audit/success level
\033 e A at the audit/failure level

For eventlog escapes, the message that will be added must follow the escape sequence on the same line. If the message contains embedded newlines, they must be replaced with \014 (form feed) control character.

When winserv receives a control code from the service manager, it sends a line to the application's standard input. The line is just a name like STOP or CONTINUE. You can get all possible names if you remove leading SERVICE_CONTROL_ from macros used for the ControlService function. For the user control codes (128–255), one of CODE128..CODE255 will be sent.

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]