bdefdbedf646d8a479333cd2467f829571e9d0e6
[nssm.git] / nssm.h
1 #ifndef NSSM_H\r
2 #define NSSM_H\r
3 \r
4 #define _WIN32_WINNT 0x0500\r
5 #include <shlwapi.h>\r
6 #include <stdarg.h>\r
7 #include <stdio.h>\r
8 #include <tchar.h>\r
9 #include <windows.h>\r
10 #include "service.h"\r
11 #include "event.h"\r
12 #include "imports.h"\r
13 #include "messages.h"\r
14 #include "process.h"\r
15 #include "registry.h"\r
16 #include "io.h"\r
17 #include "gui.h"\r
18 \r
19 int str_equiv(const TCHAR *, const TCHAR *);\r
20 void strip_basename(TCHAR *);\r
21 \r
22 #define NSSM _T("nssm")\r
23 #define NSSM_VERSION _T("2.21")\r
24 #define NSSM_VERSIONINFO 2,21,0,0\r
25 #define NSSM_DATE _T("2013-11-24")\r
26 \r
27 /*\r
28   Throttle the restart of the service if it stops before this many\r
29   milliseconds have elapsed since startup.  Override in registry.\r
30 */\r
31 #define NSSM_RESET_THROTTLE_RESTART 1500\r
32 \r
33 /*\r
34   How many milliseconds to wait for the application to die after sending\r
35   a Control-C event to its console.  Override in registry.\r
36 */\r
37 #define NSSM_KILL_CONSOLE_GRACE_PERIOD 1500\r
38 /*\r
39   How many milliseconds to wait for the application to die after posting to\r
40   its windows' message queues.  Override in registry.\r
41 */\r
42 #define NSSM_KILL_WINDOW_GRACE_PERIOD 1500\r
43 /*\r
44   How many milliseconds to wait for the application to die after posting to\r
45   its threads' message queues.  Override in registry.\r
46 */\r
47 #define NSSM_KILL_THREADS_GRACE_PERIOD 1500\r
48 \r
49 /* Margin of error for service status wait hints in milliseconds. */\r
50 #define NSSM_WAITHINT_MARGIN 2000\r
51 \r
52 /* Methods used to try to stop the application. */\r
53 #define NSSM_STOP_METHOD_CONSOLE (1 << 0)\r
54 #define NSSM_STOP_METHOD_WINDOW (1 << 1)\r
55 #define NSSM_STOP_METHOD_THREADS (1 << 2)\r
56 #define NSSM_STOP_METHOD_TERMINATE (1 << 3)\r
57 \r
58 /* Startup types. */\r
59 #define NSSM_STARTUP_AUTOMATIC 0\r
60 #define NSSM_STARTUP_DELAYED 1\r
61 #define NSSM_STARTUP_MANUAL 2\r
62 #define NSSM_STARTUP_DISABLED 3\r
63 \r
64 /* Exit actions. */\r
65 #define NSSM_EXIT_RESTART 0\r
66 #define NSSM_EXIT_IGNORE 1\r
67 #define NSSM_EXIT_REALLY 2\r
68 #define NSSM_EXIT_UNCLEAN 3\r
69 #define NSSM_NUM_EXIT_ACTIONS 4\r
70 \r
71 /* How many milliseconds to wait before updating service status. */\r
72 #define NSSM_SERVICE_STATUS_DEADLINE 20000\r
73 \r
74 #endif\r