#include "config.h"
#include "winrc/w_inst.h"
#include "winrc/win_svc.h"
Functions | |
void | wsvc_err2str (char *str, size_t len, const char *fixed, DWORD err) |
Convert windows GetLastError() value to a neat string. | |
static void | fatal_win (FILE *out, const char *str) |
exit with windows error | |
static void | event_reg_install (FILE *out, const char *pathname) |
install registry entries for eventlog | |
static void | event_reg_remove (FILE *out) |
remove registry entries for eventlog | |
static void | quote_it (FILE *out, char *str, size_t maxlen) |
put quotes around string. | |
static void | change (FILE *out, char *path, size_t max, const char *from, const char *to) |
change suffix | |
void | wsvc_install (FILE *out, const char *rename) |
Install service in servicecontrolmanager, setup registry. | |
void | wsvc_remove (FILE *out) |
Remove installed service from servicecontrolmanager, registry entries. | |
void | wsvc_rc_start (FILE *out) |
Start the service from servicecontrolmanager, tells OS to start daemon. | |
void | wsvc_rc_stop (FILE *out) |
Stop the service from servicecontrolmanager, tells OS to stop daemon. |
void wsvc_err2str | ( | char * | str, | |
size_t | len, | |||
const char * | fixed, | |||
DWORD | err | |||
) |
Convert windows GetLastError() value to a neat string.
str,: | destination buffer | |
len,: | length of dest buffer | |
fixed,: | fixed text to prepend to string. | |
err,: | the GetLastError() value. |
Referenced by fatal_win(), and reportev().
static void quote_it | ( | FILE * | out, | |
char * | str, | |||
size_t | maxlen | |||
) | [static] |
put quotes around string.
Needs one space in front
out,: | debugfile | |
str,: | to be quoted. | |
maxlen,: | max length of the string buffer. |
Referenced by wsvc_install().
void wsvc_install | ( | FILE * | out, | |
const char * | rename | |||
) |
Install service in servicecontrolmanager, setup registry.
out,: | debug output printed here (errors). or NULL. | |
rename,: | if nonNULL this executable is not unbound.exe but this name. |
References change(), event_reg_install(), fatal_win(), quote_it(), and SERVICE_NAME.
Referenced by main(), and wsvc_command_option().
void wsvc_remove | ( | FILE * | out | ) |
Remove installed service from servicecontrolmanager, registry entries.
out,: | debug output printed here (errors). or NULL. |
References event_reg_remove(), fatal_win(), and SERVICE_NAME.
Referenced by main(), and wsvc_command_option().
void wsvc_rc_start | ( | FILE * | out | ) |
Start the service from servicecontrolmanager, tells OS to start daemon.
out,: | debug output printed here (errors). or NULL. |
References fatal_win(), and SERVICE_NAME.
Referenced by main().
void wsvc_rc_stop | ( | FILE * | out | ) |
Stop the service from servicecontrolmanager, tells OS to stop daemon.
out,: | debug output printed here (errors). or NULL. |
References fatal_win(), and SERVICE_NAME.
Referenced by main().