registry.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef REGISTRY_H
  2. #define REGISTRY_H
  3. #define NSSM_REGISTRY _T("SYSTEM\\CurrentControlSet\\Services\\%s\\Parameters")
  4. #define NSSM_REG_EXE _T("Application")
  5. #define NSSM_REG_FLAGS _T("AppParameters")
  6. #define NSSM_REG_DIR _T("AppDirectory")
  7. #define NSSM_REG_ENV _T("AppEnvironment")
  8. #define NSSM_REG_ENV_EXTRA _T("AppEnvironmentExtra")
  9. #define NSSM_REG_EXIT _T("AppExit")
  10. #define NSSM_REG_THROTTLE _T("AppThrottle")
  11. #define NSSM_REG_STOP_METHOD_SKIP _T("AppStopMethodSkip")
  12. #define NSSM_REG_KILL_CONSOLE_GRACE_PERIOD _T("AppStopMethodConsole")
  13. #define NSSM_REG_KILL_WINDOW_GRACE_PERIOD _T("AppStopMethodWindow")
  14. #define NSSM_REG_KILL_THREADS_GRACE_PERIOD _T("AppStopMethodThreads")
  15. #define NSSM_REG_STDIN _T("AppStdin")
  16. #define NSSM_REG_STDOUT _T("AppStdout")
  17. #define NSSM_REG_STDERR _T("AppStderr")
  18. #define NSSM_REG_STDIO_SHARING _T("ShareMode")
  19. #define NSSM_REG_STDIO_DISPOSITION _T("CreationDisposition")
  20. #define NSSM_REG_STDIO_FLAGS _T("FlagsAndAttributes")
  21. #define NSSM_REG_ROTATE _T("AppRotateFiles")
  22. #define NSSM_REG_ROTATE_SECONDS _T("AppRotateSeconds")
  23. #define NSSM_REG_ROTATE_BYTES_LOW _T("AppRotateBytes")
  24. #define NSSM_REG_ROTATE_BYTES_HIGH _T("AppRotateBytesHigh")
  25. #define NSSM_STDIO_LENGTH 29
  26. HKEY open_registry(const TCHAR *, const TCHAR *, REGSAM sam);
  27. HKEY open_registry(const TCHAR *, REGSAM sam);
  28. int create_messages();
  29. int create_parameters(nssm_service_t *, bool);
  30. int create_exit_action(TCHAR *, const TCHAR *, bool);
  31. int set_environment(TCHAR *, HKEY, TCHAR *, TCHAR **, unsigned long *);
  32. int format_environment(TCHAR *, unsigned long, TCHAR **, unsigned long *);
  33. int unformat_environment(TCHAR *, unsigned long, TCHAR **, unsigned long *);
  34. int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool);
  35. int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool);
  36. int set_expand_string(HKEY, TCHAR *, TCHAR *);
  37. int set_number(HKEY, TCHAR *, unsigned long);
  38. int get_number(HKEY, TCHAR *, unsigned long *, bool);
  39. int get_number(HKEY, TCHAR *, unsigned long *);
  40. void override_milliseconds(TCHAR *, HKEY, TCHAR *, unsigned long *, unsigned long, unsigned long);
  41. int get_parameters(nssm_service_t *, STARTUPINFO *);
  42. int get_exit_action(const TCHAR *, unsigned long *, TCHAR *, bool *);
  43. #endif