Corrected restart throttling documentation.
[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 <windows.h>\r
9 #include "event.h"\r
10 #include "messages.h"\r
11 #include "process.h"\r
12 #include "registry.h"\r
13 #include "service.h"\r
14 #include "gui.h"\r
15 \r
16 int str_equiv(const char *, const char *);\r
17 \r
18 #define NSSM "nssm"\r
19 #define NSSM_VERSION "2.7"\r
20 #define NSSM_DATE "2011-01-25"\r
21 #define NSSM_RUN "run"\r
22 \r
23 /*\r
24   MSDN says the commandline in CreateProcess() is limited to 32768 characters\r
25   and the application name to MAX_PATH.\r
26   A registry key is limited to 255 characters.\r
27   A registry value is limited to 16383 characters.\r
28   Therefore we limit the service name to accommodate the path under HKLM.\r
29 */\r
30 #define EXE_LENGTH MAX_PATH\r
31 #define CMD_LENGTH 32768\r
32 #define KEY_LENGTH 255\r
33 #define VALUE_LENGTH 16383\r
34 #define SERVICE_NAME_LENGTH KEY_LENGTH - 55\r
35 \r
36 /*\r
37   Throttle the restart of the service if it stops before this many\r
38   milliseconds have elapsed since startup.\r
39 */\r
40 #define NSSM_RESET_THROTTLE_RESTART 1500\r
41 \r
42 /*\r
43   How many milliseconds to wait for the application to die after posting to\r
44   its windows' message queues.\r
45 */\r
46 #define NSSM_KILL_WINDOW_GRACE_PERIOD 1500\r
47 /*\r
48   How many milliseconds to wait for the application to die after posting to\r
49   its threads' message queues.\r
50 */\r
51 #define NSSM_KILL_THREADS_GRACE_PERIOD 1500\r
52 \r
53 /* Margin of error for service status wait hints in milliseconds. */\r
54 #define NSSM_WAITHINT_MARGIN 2000\r
55 \r
56 #endif\r