settings.h 1.3 KB

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