4 #define _WIN32_WINNT 0x0500
\r
10 #include "service.h"
\r
12 #include "imports.h"
\r
13 #include "messages.h"
\r
14 #include "process.h"
\r
15 #include "registry.h"
\r
16 #include "settings.h"
\r
20 int str_equiv(const TCHAR *, const TCHAR *);
\r
21 void strip_basename(TCHAR *);
\r
22 int str_number(const TCHAR *, unsigned long *, TCHAR **);
\r
23 int str_number(const TCHAR *, unsigned long *);
\r
27 #define NSSM _T("NSSM")
\r
29 #define NSSM_ARCHITECTURE _T("64-bit")
\r
31 #define NSSM_ARCHITECTURE _T("32-bit")
\r
34 #define NSSM_DEBUG _T(" debug")
\r
36 #define NSSM_DEBUG _T("")
\r
38 #define NSSM_CONFIGURATION NSSM_ARCHITECTURE NSSM_DEBUG
\r
39 #include "version.h"
\r
42 Throttle the restart of the service if it stops before this many
\r
43 milliseconds have elapsed since startup. Override in registry.
\r
45 #define NSSM_RESET_THROTTLE_RESTART 1500
\r
48 How many milliseconds to wait for the application to die after sending
\r
49 a Control-C event to its console. Override in registry.
\r
51 #define NSSM_KILL_CONSOLE_GRACE_PERIOD 1500
\r
53 How many milliseconds to wait for the application to die after posting to
\r
54 its windows' message queues. Override in registry.
\r
56 #define NSSM_KILL_WINDOW_GRACE_PERIOD 1500
\r
58 How many milliseconds to wait for the application to die after posting to
\r
59 its threads' message queues. Override in registry.
\r
61 #define NSSM_KILL_THREADS_GRACE_PERIOD 1500
\r
63 /* Margin of error for service status wait hints in milliseconds. */
\r
64 #define NSSM_WAITHINT_MARGIN 2000
\r
66 /* Methods used to try to stop the application. */
\r
67 #define NSSM_STOP_METHOD_CONSOLE (1 << 0)
\r
68 #define NSSM_STOP_METHOD_WINDOW (1 << 1)
\r
69 #define NSSM_STOP_METHOD_THREADS (1 << 2)
\r
70 #define NSSM_STOP_METHOD_TERMINATE (1 << 3)
\r
72 /* Startup types. */
\r
73 #define NSSM_STARTUP_AUTOMATIC 0
\r
74 #define NSSM_STARTUP_DELAYED 1
\r
75 #define NSSM_STARTUP_MANUAL 2
\r
76 #define NSSM_STARTUP_DISABLED 3
\r
79 #define NSSM_EXIT_RESTART 0
\r
80 #define NSSM_EXIT_IGNORE 1
\r
81 #define NSSM_EXIT_REALLY 2
\r
82 #define NSSM_EXIT_UNCLEAN 3
\r
83 #define NSSM_NUM_EXIT_ACTIONS 4
\r
85 /* Process priority. */
\r
86 #define NSSM_REALTIME_PRIORITY 0
\r
87 #define NSSM_HIGH_PRIORITY 1
\r
88 #define NSSM_ABOVE_NORMAL_PRIORITY 2
\r
89 #define NSSM_NORMAL_PRIORITY 3
\r
90 #define NSSM_BELOW_NORMAL_PRIORITY 4
\r
91 #define NSSM_IDLE_PRIORITY 5
\r
93 /* How many milliseconds to wait before updating service status. */
\r
94 #define NSSM_SERVICE_STATUS_DEADLINE 20000
\r