nssm.h 1.5 KB

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