Valid commands are:\r
start, stop, pause, continue, install, edit, get, set, reset, unset, remove\r
*/\r
- if (str_equiv(argv[1], _T("start"))) exit(control_service(0, argc - 2, argv + 2));\r
+ if (str_equiv(argv[1], _T("start"))) exit(control_service(NSSM_SERVICE_CONTROL_START, argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("stop"))) exit(control_service(SERVICE_CONTROL_STOP, argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("pause"))) exit(control_service(SERVICE_CONTROL_PAUSE, argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("continue"))) exit(control_service(SERVICE_CONTROL_CONTINUE, argc - 2, argv + 2));\r
#define NSSM_SERVICE_STATUS_DEADLINE 20000\r
\r
/* User-defined service controls can be in the range 128-255. */\r
+#define NSSM_SERVICE_CONTROL_START 0\r
#define NSSM_SERVICE_CONTROL_ROTATE 128\r
\r
#endif\r
int ret;\r
unsigned long error;\r
SERVICE_STATUS service_status;\r
- if (control == 0) {\r
+ if (control == NSSM_SERVICE_CONTROL_START) {\r
ret = StartService(service_handle, (unsigned long) argc, (const TCHAR **) argv);\r
error = GetLastError();\r
CloseHandle(service_handle);\r
TCHAR *service_control_text(unsigned long control) {\r
switch (control) {\r
/* HACK: there is no SERVICE_CONTROL_START constant */\r
- case 0: return _T("START");\r
+ case NSSM_SERVICE_CONTROL_START: return _T("START");\r
case SERVICE_CONTROL_STOP: return _T("STOP");\r
case SERVICE_CONTROL_SHUTDOWN: return _T("SHUTDOWN");\r
case SERVICE_CONTROL_PAUSE: return _T("PAUSE");\r