registry.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef REGISTRY_H
  2. #define REGISTRY_H
  3. #define NSSM_REGISTRY _T("SYSTEM\\CurrentControlSet\\Services\\%s")
  4. #define NSSM_REG_PARAMETERS _T("Parameters")
  5. #define NSSM_REGISTRY_GROUPS _T("SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder")
  6. #define NSSM_REG_GROUPS _T("List")
  7. #define NSSM_REG_EXE _T("Application")
  8. #define NSSM_REG_FLAGS _T("AppParameters")
  9. #define NSSM_REG_DIR _T("AppDirectory")
  10. #define NSSM_REG_ENV _T("AppEnvironment")
  11. #define NSSM_REG_ENV_EXTRA _T("AppEnvironmentExtra")
  12. #define NSSM_REG_EXIT _T("AppExit")
  13. #define NSSM_REG_RESTART_DELAY _T("AppRestartDelay")
  14. #define NSSM_REG_THROTTLE _T("AppThrottle")
  15. #define NSSM_REG_STOP_METHOD_SKIP _T("AppStopMethodSkip")
  16. #define NSSM_REG_KILL_CONSOLE_GRACE_PERIOD _T("AppStopMethodConsole")
  17. #define NSSM_REG_KILL_WINDOW_GRACE_PERIOD _T("AppStopMethodWindow")
  18. #define NSSM_REG_KILL_THREADS_GRACE_PERIOD _T("AppStopMethodThreads")
  19. #define NSSM_REG_KILL_PROCESS_TREE _T("AppKillProcessTree")
  20. #define NSSM_REG_STDIN _T("AppStdin")
  21. #define NSSM_REG_STDOUT _T("AppStdout")
  22. #define NSSM_REG_STDERR _T("AppStderr")
  23. #define NSSM_REG_STDIO_SHARING _T("ShareMode")
  24. #define NSSM_REG_STDIO_DISPOSITION _T("CreationDisposition")
  25. #define NSSM_REG_STDIO_FLAGS _T("FlagsAndAttributes")
  26. #define NSSM_REG_STDIO_COPY_AND_TRUNCATE _T("CopyAndTruncate")
  27. #define NSSM_REG_ROTATE _T("AppRotateFiles")
  28. #define NSSM_REG_ROTATE_ONLINE _T("AppRotateOnline")
  29. #define NSSM_REG_ROTATE_SECONDS _T("AppRotateSeconds")
  30. #define NSSM_REG_ROTATE_BYTES_LOW _T("AppRotateBytes")
  31. #define NSSM_REG_ROTATE_BYTES_HIGH _T("AppRotateBytesHigh")
  32. #define NSSM_REG_ROTATE_DELAY _T("AppRotateDelay")
  33. #define NSSM_REG_PRIORITY _T("AppPriority")
  34. #define NSSM_REG_AFFINITY _T("AppAffinity")
  35. #define NSSM_REG_NO_CONSOLE _T("AppNoConsole")
  36. #define NSSM_REG_HOOK _T("AppEvents")
  37. #define NSSM_STDIO_LENGTH 29
  38. HKEY open_service_registry(const TCHAR *, REGSAM sam, bool);
  39. HKEY open_registry(const TCHAR *, const TCHAR *, REGSAM sam, bool);
  40. HKEY open_registry(const TCHAR *, const TCHAR *, REGSAM sam);
  41. HKEY open_registry(const TCHAR *, REGSAM sam);
  42. int create_messages();
  43. int create_parameters(nssm_service_t *, bool);
  44. int create_exit_action(TCHAR *, const TCHAR *, bool);
  45. int get_environment(TCHAR *, HKEY, TCHAR *, TCHAR **, unsigned long *);
  46. int get_string(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool, bool);
  47. int get_string(HKEY, TCHAR *, TCHAR *, unsigned long, bool);
  48. int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool);
  49. int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool);
  50. int set_string(HKEY, TCHAR *, TCHAR *, bool);
  51. int set_string(HKEY, TCHAR *, TCHAR *);
  52. int set_expand_string(HKEY, TCHAR *, TCHAR *);
  53. int set_number(HKEY, TCHAR *, unsigned long);
  54. int get_number(HKEY, TCHAR *, unsigned long *, bool);
  55. int get_number(HKEY, TCHAR *, unsigned long *);
  56. int format_double_null(TCHAR *, unsigned long, TCHAR **, unsigned long *);
  57. int unformat_double_null(TCHAR *, unsigned long, TCHAR **, unsigned long *);
  58. void override_milliseconds(TCHAR *, HKEY, TCHAR *, unsigned long *, unsigned long, unsigned long);
  59. int get_io_parameters(nssm_service_t *, HKEY);
  60. int get_parameters(nssm_service_t *, STARTUPINFO *);
  61. int get_exit_action(const TCHAR *, unsigned long *, TCHAR *, bool *);
  62. int set_hook(const TCHAR *, const TCHAR *, const TCHAR *, TCHAR *);
  63. int get_hook(const TCHAR *, const TCHAR *, const TCHAR *, TCHAR *, unsigned long);
  64. #endif