nssm.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.9"
  17. #define NSSM_DATE "2011-02-28"
  18. #define NSSM_RUN "run"
  19. /*
  20. MSDN says the commandline in CreateProcess() is limited to 32768 characters
  21. and the application name to MAX_PATH.
  22. A registry key is limited to 255 characters.
  23. A registry value is limited to 16383 characters.
  24. Therefore we limit the service name to accommodate the path under HKLM.
  25. */
  26. #define EXE_LENGTH MAX_PATH
  27. #define CMD_LENGTH 32768
  28. #define KEY_LENGTH 255
  29. #define VALUE_LENGTH 16383
  30. #define SERVICE_NAME_LENGTH KEY_LENGTH - 55
  31. /*
  32. Throttle the restart of the service if it stops before this many
  33. milliseconds have elapsed since startup. Override in registry.
  34. */
  35. #define NSSM_RESET_THROTTLE_RESTART 1500
  36. /*
  37. How many milliseconds to wait for the application to die after posting to
  38. its windows' message queues.
  39. */
  40. #define NSSM_KILL_WINDOW_GRACE_PERIOD 1500
  41. /*
  42. How many milliseconds to wait for the application to die after posting to
  43. its threads' message queues.
  44. */
  45. #define NSSM_KILL_THREADS_GRACE_PERIOD 1500
  46. /* Margin of error for service status wait hints in milliseconds. */
  47. #define NSSM_WAITHINT_MARGIN 2000
  48. #endif