nssm.h 1.8 KB

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