settings.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef SETTINGS_H
  2. #define SETTINGS_H
  3. #define NSSM_NATIVE_DESCRIPTION _T("Description")
  4. #define NSSM_NATIVE_DISPLAYNAME _T("DisplayName")
  5. #define NSSM_NATIVE_IMAGEPATH _T("ImagePath")
  6. #define NSSM_NATIVE_OBJECTNAME _T("ObjectName")
  7. #define NSSM_NATIVE_STARTUP _T("Start")
  8. #define NSSM_NATIVE_TYPE _T("Type")
  9. /* Are additional arguments needed? */
  10. #define ADDITIONAL_GETTING (1 << 0)
  11. #define ADDITIONAL_SETTING (1 << 1)
  12. #define ADDITIONAL_RESETTING (1 << 2)
  13. #define ADDITIONAL_CRLF (1 << 3)
  14. #define ADDITIONAL_MANDATORY ADDITIONAL_GETTING|ADDITIONAL_SETTING|ADDITIONAL_RESETTING
  15. typedef union {
  16. unsigned long numeric;
  17. TCHAR *string;
  18. } value_t;
  19. typedef int (*setting_function_t)(const TCHAR *, void *, const TCHAR *, void *, value_t *, const TCHAR *);
  20. typedef struct {
  21. const TCHAR *name;
  22. unsigned long type;
  23. void *default_value;
  24. bool native;
  25. int additional;
  26. setting_function_t set;
  27. setting_function_t get;
  28. } settings_t;
  29. int set_setting(const TCHAR *, HKEY, settings_t *, value_t *, const TCHAR *);
  30. int set_setting(const TCHAR *, SC_HANDLE, settings_t *, value_t *, const TCHAR *);
  31. int get_setting(const TCHAR *, HKEY, settings_t *, value_t *, const TCHAR *);
  32. int get_setting(const TCHAR *, SC_HANDLE, settings_t *, value_t *, const TCHAR *);
  33. #endif