registry.h 2.9 KB

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