nssm.h 2.0 KB

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