return (str_equiv(value, NSSM_DEFAULT_STRING) || str_equiv(value, _T("*")) || ! value[0]);\r
}\r
\r
+/* What type of parameter is it parameter? */\r
+static inline bool is_string_type(const unsigned long type) {\r
+ return (type == REG_MULTI_SZ || type == REG_EXPAND_SZ || type == REG_SZ);\r
+}\r
+static inline bool is_numeric_type(const unsigned long type) {\r
+ return (type == REG_DWORD);\r
+}\r
+\r
static int value_from_string(const TCHAR *name, value_t *value, const TCHAR *string) {\r
size_t len = _tcslen(string);\r
if (! len++) {\r
return value_from_string(name, value, buffer);\r
}\r
\r
+static int setting_not_dumpable(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ return 0;\r
+}\r
+\r
+static int setting_dump_string(const TCHAR *service_name, void *param, const TCHAR *name, const value_t *value, const TCHAR *additional) {\r
+ TCHAR quoted_service_name[SERVICE_NAME_LENGTH * 2];\r
+ TCHAR quoted_value[VALUE_LENGTH * 2];\r
+ TCHAR quoted_additional[VALUE_LENGTH * 2];\r
+ TCHAR quoted_nssm[EXE_LENGTH * 2];\r
+\r
+ if (quote(service_name, quoted_service_name, _countof(quoted_service_name))) return 1;\r
+\r
+ if (additional) {\r
+ if (_tcslen(additional)) {\r
+ if (quote(additional, quoted_additional, _countof(quoted_additional))) return 3;\r
+ }\r
+ else _sntprintf_s(quoted_additional, _countof(quoted_additional), _TRUNCATE, _T("\"\""));\r
+ }\r
+ else quoted_additional[0] = _T('\0');\r
+\r
+ unsigned long type = (unsigned long) param;\r
+ if (is_string_type(type)) {\r
+ if (_tcslen(value->string)) {\r
+ if (quote(value->string, quoted_value, _countof(quoted_value))) return 2;\r
+ }\r
+ else _sntprintf_s(quoted_value, _countof(quoted_value), _TRUNCATE, _T("\"\""));\r
+ }\r
+ else if (is_numeric_type(type)) _sntprintf_s(quoted_value, _countof(quoted_value), _TRUNCATE, _T("%lu"), value->numeric);\r
+ else return 2;\r
+\r
+ if (quote(nssm_exe(), quoted_nssm, _countof(quoted_nssm))) return 3;\r
+ if (_tcslen(quoted_additional)) _tprintf(_T("%s set %s %s %s %s\n"), quoted_nssm, quoted_service_name, name, quoted_additional, quoted_value);\r
+ else _tprintf(_T("%s set %s %s %s\n"), quoted_nssm, quoted_service_name, name, quoted_value);\r
+ return 0;\r
+}\r
+\r
static int setting_set_exit_action(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
unsigned long exitcode;\r
TCHAR *code;\r
return 1;\r
}\r
\r
+static int setting_dump_exit_action(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ int errors = 0;\r
+ HKEY key = open_registry(service_name, NSSM_REG_EXIT, KEY_READ);\r
+ if (! key) return -1;\r
+\r
+ TCHAR code[16];\r
+ unsigned long index = 0;\r
+ while (true) {\r
+ int ret = enumerate_registry_values(key, &index, code, _countof(code));\r
+ if (ret == ERROR_NO_MORE_ITEMS) break;\r
+ if (ret != ERROR_SUCCESS) continue;\r
+ bool valid = true;\r
+ int i;\r
+ for (i = 0; i < _countof(code); i++) {\r
+ if (! code[i]) break;\r
+ if (code[i] >= _T('0') || code[i] <= _T('9')) continue;\r
+ valid = false;\r
+ break;\r
+ }\r
+ if (! valid) continue;\r
+\r
+ TCHAR *additional = (code[i]) ? code : NSSM_DEFAULT_STRING;\r
+\r
+ ret = setting_get_exit_action(service_name, 0, name, default_value, value, additional);\r
+ if (ret == 1) {\r
+ if (setting_dump_string(service_name, (void *) REG_SZ, name, value, additional)) errors++;\r
+ }\r
+ else if (ret < 0) errors++;\r
+ }\r
+\r
+ if (errors) return -1;\r
+ return 0;\r
+}\r
+\r
static inline bool split_hook_name(const TCHAR *hook_name, TCHAR *hook_event, TCHAR *hook_action) {\r
TCHAR *s;\r
\r
return 1;\r
}\r
\r
+static int setting_dump_hooks(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ int i, j;\r
+\r
+ int errors = 0;\r
+ for (i = 0; hook_event_strings[i]; i++) {\r
+ const TCHAR *hook_event = hook_event_strings[i];\r
+ for (j = 0; hook_action_strings[j]; j++) {\r
+ const TCHAR *hook_action = hook_action_strings[j];\r
+ if (! valid_hook_name(hook_event, hook_action, true)) continue;\r
+\r
+ TCHAR hook_name[HOOK_NAME_LENGTH];\r
+ _sntprintf_s(hook_name, _countof(hook_name), _TRUNCATE, _T("%s/%s"), hook_event, hook_action);\r
+\r
+ int ret = setting_get_hook(service_name, param, name, default_value, value, hook_name);\r
+ if (ret != 1) {\r
+ if (ret < 0) errors++;\r
+ continue;\r
+ }\r
+\r
+ if (setting_dump_string(service_name, (void *) REG_SZ, name, value, hook_name)) errors++;\r
+ }\r
+ }\r
+\r
+ if (errors) return -1;\r
+ return 0;\r
+}\r
+\r
static int setting_set_affinity(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
HKEY key = (HKEY) param;\r
if (! key) return -1;\r
return ret;\r
}\r
\r
+static int setting_dump_environment(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ int errors = 0;\r
+ HKEY key = (HKEY) param;\r
+ if (! param) return -1;\r
+\r
+ TCHAR *env = 0;\r
+ unsigned long envlen;\r
+ if (get_environment((TCHAR *) service_name, key, (TCHAR *) name, &env, &envlen)) return -1;\r
+ if (! envlen) return 0;\r
+\r
+ TCHAR *s;\r
+ for (s = env; *s; s++) {\r
+ size_t len = _tcslen(s) + 2;\r
+ value->string = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, len * sizeof(TCHAR));\r
+ if (! value->string) {\r
+ print_message(stderr, NSSM_MESSAGE_OUT_OF_MEMORY, _T("dump"), _T("setting_dump_environment"));\r
+ break;\r
+ }\r
+\r
+ _sntprintf_s(value->string, len, _TRUNCATE, _T("%c%s"), (s > env) ? _T('+') : _T(':'), s);\r
+ if (setting_dump_string(service_name, (void *) REG_SZ, name, value, 0)) errors++;\r
+ HeapFree(GetProcessHeap(), 0, value->string);\r
+ value->string = 0;\r
+\r
+ for ( ; *s; s++);\r
+ }\r
+\r
+ HeapFree(GetProcessHeap(), 0, env);\r
+\r
+ if (errors) return 1;\r
+ return 0;\r
+}\r
+\r
static int setting_set_priority(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
HKEY key = (HKEY) param;\r
if (! param) return -1;\r
return value_from_string(name, value, priority_strings[priority_constant_to_index(constant)]);\r
}\r
\r
+static int setting_dump_priority(const TCHAR *service_name, void *key_ptr, const TCHAR *name, void *setting_ptr, value_t *value, const TCHAR *additional) {\r
+ settings_t *setting = (settings_t *) setting_ptr;\r
+ int ret = setting_get_priority(service_name, key_ptr, name, (void *) setting->default_value, value, 0);\r
+ if (ret != 1) return ret;\r
+ return setting_dump_string(service_name, (void *) REG_SZ, name, value, 0);\r
+}\r
+\r
/* Functions to manage native service settings. */\r
static int native_set_dependon(const TCHAR *service_name, SC_HANDLE service_handle, TCHAR **dependencies, unsigned long *dependencieslen, value_t *value, int type) {\r
*dependencieslen = 0;\r
return ret;\r
}\r
\r
+static int setting_dump_dependon(const TCHAR *service_name, SC_HANDLE service_handle, const TCHAR *name, int type, value_t *value) {\r
+ int errors = 0;\r
+\r
+ TCHAR *dependencies = 0;\r
+ unsigned long dependencieslen;\r
+ if (get_service_dependencies(service_name, service_handle, &dependencies, &dependencieslen, type)) return -1;\r
+ if (! dependencieslen) return 0;\r
+\r
+ TCHAR *s;\r
+ for (s = dependencies; *s; s++) {\r
+ size_t len = _tcslen(s) + 2;\r
+ value->string = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, len * sizeof(TCHAR));\r
+ if (! value->string) {\r
+ print_message(stderr, NSSM_MESSAGE_OUT_OF_MEMORY, _T("dump"), _T("setting_dump_dependon"));\r
+ break;\r
+ }\r
+\r
+ _sntprintf_s(value->string, len, _TRUNCATE, _T("%c%s"), (s > dependencies) ? _T('+') : _T(':'), s);\r
+ if (setting_dump_string(service_name, (void *) REG_SZ, name, value, 0)) errors++;\r
+ HeapFree(GetProcessHeap(), 0, value->string);\r
+ value->string = 0;\r
+\r
+ for ( ; *s; s++);\r
+ }\r
+\r
+ HeapFree(GetProcessHeap(), 0, dependencies);\r
+\r
+ if (errors) return 1;\r
+ return 0;\r
+}\r
+\r
+static int native_dump_dependongroup(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ return setting_dump_dependon(service_name, (SC_HANDLE) param, name, DEPENDENCY_GROUPS, value);\r
+}\r
+\r
static int native_set_dependonservice(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
SC_HANDLE service_handle = (SC_HANDLE) param;\r
if (! service_handle) return -1;\r
return ret;\r
}\r
\r
+static int native_dump_dependonservice(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ return setting_dump_dependon(service_name, (SC_HANDLE) param, name, DEPENDENCY_SERVICES, value);\r
+}\r
+\r
int native_set_description(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
SC_HANDLE service_handle = (SC_HANDLE) param;\r
if (! service_handle) return -1;\r
return ret;\r
}\r
\r
+static int native_dump_environment(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ HKEY key = open_service_registry(service_name, KEY_READ, true);\r
+ if (! key) return -1;\r
+\r
+ int ret = setting_dump_environment(service_name, (void *) key, name, default_value, value, additional);\r
+ RegCloseKey(key);\r
+ return ret;\r
+}\r
+\r
int native_set_imagepath(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
SC_HANDLE service_handle = (SC_HANDLE) param;\r
if (! service_handle) return -1;\r
return ret;\r
}\r
\r
+int native_dump_objectname(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
+ int ret = native_get_objectname(service_name, param, name, default_value, value, additional);\r
+ if (ret != 1) return ret;\r
+\r
+ /* Do we need to dump a dummy password? */\r
+ if (! well_known_username(value->string)) {\r
+ /* Parameters are the other way round. */\r
+ value_t inverted;\r
+ inverted.string = _T("****");\r
+ return setting_dump_string(service_name, (void *) REG_SZ, name, &inverted, value->string);\r
+ }\r
+ return setting_dump_string(service_name, (void *) REG_SZ, name, value, 0);\r
+}\r
+\r
int native_set_startup(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {\r
SC_HANDLE service_handle = (SC_HANDLE) param;\r
if (! service_handle) return -1;\r
if (! key) return -1;\r
int ret;\r
\r
- switch (setting->type) {\r
- case REG_EXPAND_SZ:\r
- case REG_MULTI_SZ:\r
- case REG_SZ:\r
- value->string = (TCHAR *) setting->default_value;\r
- if (setting->get) ret = setting->get(service_name, (void *) key, setting->name, setting->default_value, value, additional);\r
- else ret = -1;\r
- break;\r
-\r
- case REG_DWORD:\r
- value->numeric = PtrToUlong(setting->default_value);\r
- if (setting->get) ret = setting->get(service_name, (void *) key, setting->name, setting->default_value, value, additional);\r
- else ret = -1;\r
- break;\r
-\r
- default:\r
- ret = -1;\r
- break;\r
+ if (is_string_type(setting->type)) {\r
+ value->string = (TCHAR *) setting->default_value;\r
+ if (setting->get) ret = setting->get(service_name, (void *) key, setting->name, setting->default_value, value, additional);\r
+ else ret = -1;\r
+ }\r
+ else if (is_numeric_type(setting->type)) {\r
+ value->numeric = PtrToUlong(setting->default_value);\r
+ if (setting->get) ret = setting->get(service_name, (void *) key, setting->name, setting->default_value, value, additional);\r
+ else ret = -1;\r
}\r
+ else ret = -1;\r
\r
if (ret < 0) print_message(stderr, NSSM_MESSAGE_GET_SETTING_FAILED, setting->name, service_name);\r
\r
return setting->get(service_name, service_handle, setting->name, 0, value, additional);\r
}\r
\r
+int dump_setting(const TCHAR *service_name, HKEY key, SC_HANDLE service_handle, settings_t *setting) {\r
+ void *param;\r
+ if (setting->native) {\r
+ if (! service_handle) return -1;\r
+ param = (void *) service_handle;\r
+ }\r
+ else {\r
+ /* Will be null for native services. */\r
+ param = (void *) key;\r
+ }\r
+\r
+ value_t value = { 0 };\r
+ int ret;\r
+\r
+ if (setting->dump) return setting->dump(service_name, param, setting->name, (void *) setting, &value, 0);\r
+ if (setting->native) ret = get_setting(service_name, service_handle, setting, &value, 0);\r
+ else ret = get_setting(service_name, key, setting, &value, 0);\r
+ if (ret != 1) return ret;\r
+ return setting_dump_string(service_name, (void *) setting->type, setting->name, &value, 0);\r
+}\r
+\r
settings_t settings[] = {\r
- { NSSM_REG_EXE, REG_EXPAND_SZ, (void *) _T(""), false, 0, setting_set_string, setting_get_string },\r
- { NSSM_REG_FLAGS, REG_EXPAND_SZ, (void *) _T(""), false, 0, setting_set_string, setting_get_string },\r
- { NSSM_REG_DIR, REG_EXPAND_SZ, (void *) _T(""), false, 0, setting_set_string, setting_get_string },\r
- { NSSM_REG_EXIT, REG_SZ, (void *) exit_action_strings[NSSM_EXIT_RESTART], false, ADDITIONAL_MANDATORY, setting_set_exit_action, setting_get_exit_action },\r
- { NSSM_REG_HOOK, REG_SZ, (void *) _T(""), false, ADDITIONAL_MANDATORY, setting_set_hook, setting_get_hook },\r
- { NSSM_REG_AFFINITY, REG_SZ, 0, false, 0, setting_set_affinity, setting_get_affinity },\r
- { NSSM_REG_ENV, REG_MULTI_SZ, NULL, false, ADDITIONAL_CRLF, setting_set_environment, setting_get_environment },\r
- { NSSM_REG_ENV_EXTRA, REG_MULTI_SZ, NULL, false, ADDITIONAL_CRLF, setting_set_environment, setting_get_environment },\r
- { NSSM_REG_NO_CONSOLE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_PRIORITY, REG_SZ, (void *) priority_strings[NSSM_NORMAL_PRIORITY], false, 0, setting_set_priority, setting_get_priority },\r
- { NSSM_REG_RESTART_DELAY, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDIN, REG_EXPAND_SZ, NULL, false, 0, setting_set_string, setting_get_string },\r
- { NSSM_REG_STDIN NSSM_REG_STDIO_SHARING, REG_DWORD, (void *) NSSM_STDIN_SHARING, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDIN NSSM_REG_STDIO_DISPOSITION, REG_DWORD, (void *) NSSM_STDIN_DISPOSITION, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDIN NSSM_REG_STDIO_FLAGS, REG_DWORD, (void *) NSSM_STDIN_FLAGS, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDOUT, REG_EXPAND_SZ, NULL, false, 0, setting_set_string, setting_get_string },\r
- { NSSM_REG_STDOUT NSSM_REG_STDIO_SHARING, REG_DWORD, (void *) NSSM_STDOUT_SHARING, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDOUT NSSM_REG_STDIO_DISPOSITION, REG_DWORD, (void *) NSSM_STDOUT_DISPOSITION, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDOUT NSSM_REG_STDIO_FLAGS, REG_DWORD, (void *) NSSM_STDOUT_FLAGS, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDOUT NSSM_REG_STDIO_COPY_AND_TRUNCATE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDERR, REG_EXPAND_SZ, NULL, false, 0, setting_set_string, setting_get_string },\r
- { NSSM_REG_STDERR NSSM_REG_STDIO_SHARING, REG_DWORD, (void *) NSSM_STDERR_SHARING, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDERR NSSM_REG_STDIO_DISPOSITION, REG_DWORD, (void *) NSSM_STDERR_DISPOSITION, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDERR NSSM_REG_STDIO_FLAGS, REG_DWORD, (void *) NSSM_STDERR_FLAGS, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STDERR NSSM_REG_STDIO_COPY_AND_TRUNCATE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_STOP_METHOD_SKIP, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_KILL_CONSOLE_GRACE_PERIOD, REG_DWORD, (void *) NSSM_KILL_CONSOLE_GRACE_PERIOD, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_KILL_WINDOW_GRACE_PERIOD, REG_DWORD, (void *) NSSM_KILL_WINDOW_GRACE_PERIOD, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_KILL_THREADS_GRACE_PERIOD, REG_DWORD, (void *) NSSM_KILL_THREADS_GRACE_PERIOD, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_KILL_PROCESS_TREE, REG_DWORD, (void *) 1, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_THROTTLE, REG_DWORD, (void *) NSSM_RESET_THROTTLE_RESTART, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_HOOK_SHARE_OUTPUT_HANDLES, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_ROTATE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_ROTATE_ONLINE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_ROTATE_SECONDS, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_ROTATE_BYTES_LOW, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_ROTATE_BYTES_HIGH, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_REG_ROTATE_DELAY, REG_DWORD, (void *) NSSM_ROTATE_DELAY, false, 0, setting_set_number, setting_get_number },\r
- { NSSM_NATIVE_DEPENDONGROUP, REG_MULTI_SZ, NULL, true, ADDITIONAL_CRLF, native_set_dependongroup, native_get_dependongroup },\r
- { NSSM_NATIVE_DEPENDONSERVICE, REG_MULTI_SZ, NULL, true, ADDITIONAL_CRLF, native_set_dependonservice, native_get_dependonservice },\r
- { NSSM_NATIVE_DESCRIPTION, REG_SZ, _T(""), true, 0, native_set_description, native_get_description },\r
- { NSSM_NATIVE_DISPLAYNAME, REG_SZ, NULL, true, 0, native_set_displayname, native_get_displayname },\r
- { NSSM_NATIVE_ENVIRONMENT, REG_MULTI_SZ, NULL, true, ADDITIONAL_CRLF, native_set_environment, native_get_environment },\r
- { NSSM_NATIVE_IMAGEPATH, REG_EXPAND_SZ, NULL, true, 0, native_set_imagepath, native_get_imagepath },\r
- { NSSM_NATIVE_OBJECTNAME, REG_SZ, NSSM_LOCALSYSTEM_ACCOUNT, true, 0, native_set_objectname, native_get_objectname },\r
- { NSSM_NATIVE_NAME, REG_SZ, NULL, true, 0, native_set_name, native_get_name },\r
- { NSSM_NATIVE_STARTUP, REG_SZ, NULL, true, 0, native_set_startup, native_get_startup },\r
- { NSSM_NATIVE_TYPE, REG_SZ, NULL, true, 0, native_set_type, native_get_type },\r
+ { NSSM_REG_EXE, REG_EXPAND_SZ, (void *) _T(""), false, 0, setting_set_string, setting_get_string, 0 },\r
+ { NSSM_REG_FLAGS, REG_EXPAND_SZ, (void *) _T(""), false, 0, setting_set_string, setting_get_string, 0 },\r
+ { NSSM_REG_DIR, REG_EXPAND_SZ, (void *) _T(""), false, 0, setting_set_string, setting_get_string, 0 },\r
+ { NSSM_REG_EXIT, REG_SZ, (void *) exit_action_strings[NSSM_EXIT_RESTART], false, ADDITIONAL_MANDATORY, setting_set_exit_action, setting_get_exit_action, setting_dump_exit_action },\r
+ { NSSM_REG_HOOK, REG_SZ, (void *) _T(""), false, ADDITIONAL_MANDATORY, setting_set_hook, setting_get_hook, setting_dump_hooks },\r
+ { NSSM_REG_AFFINITY, REG_SZ, 0, false, 0, setting_set_affinity, setting_get_affinity, 0 },\r
+ { NSSM_REG_ENV, REG_MULTI_SZ, NULL, false, ADDITIONAL_CRLF, setting_set_environment, setting_get_environment, setting_dump_environment },\r
+ { NSSM_REG_ENV_EXTRA, REG_MULTI_SZ, NULL, false, ADDITIONAL_CRLF, setting_set_environment, setting_get_environment, setting_dump_environment },\r
+ { NSSM_REG_NO_CONSOLE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_PRIORITY, REG_SZ, (void *) priority_strings[NSSM_NORMAL_PRIORITY], false, 0, setting_set_priority, setting_get_priority, setting_dump_priority },\r
+ { NSSM_REG_RESTART_DELAY, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDIN, REG_EXPAND_SZ, NULL, false, 0, setting_set_string, setting_get_string, 0 },\r
+ { NSSM_REG_STDIN NSSM_REG_STDIO_SHARING, REG_DWORD, (void *) NSSM_STDIN_SHARING, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDIN NSSM_REG_STDIO_DISPOSITION, REG_DWORD, (void *) NSSM_STDIN_DISPOSITION, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDIN NSSM_REG_STDIO_FLAGS, REG_DWORD, (void *) NSSM_STDIN_FLAGS, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDOUT, REG_EXPAND_SZ, NULL, false, 0, setting_set_string, setting_get_string, 0 },\r
+ { NSSM_REG_STDOUT NSSM_REG_STDIO_SHARING, REG_DWORD, (void *) NSSM_STDOUT_SHARING, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDOUT NSSM_REG_STDIO_DISPOSITION, REG_DWORD, (void *) NSSM_STDOUT_DISPOSITION, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDOUT NSSM_REG_STDIO_FLAGS, REG_DWORD, (void *) NSSM_STDOUT_FLAGS, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDOUT NSSM_REG_STDIO_COPY_AND_TRUNCATE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDERR, REG_EXPAND_SZ, NULL, false, 0, setting_set_string, setting_get_string, 0 },\r
+ { NSSM_REG_STDERR NSSM_REG_STDIO_SHARING, REG_DWORD, (void *) NSSM_STDERR_SHARING, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDERR NSSM_REG_STDIO_DISPOSITION, REG_DWORD, (void *) NSSM_STDERR_DISPOSITION, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDERR NSSM_REG_STDIO_FLAGS, REG_DWORD, (void *) NSSM_STDERR_FLAGS, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STDERR NSSM_REG_STDIO_COPY_AND_TRUNCATE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_STOP_METHOD_SKIP, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_KILL_CONSOLE_GRACE_PERIOD, REG_DWORD, (void *) NSSM_KILL_CONSOLE_GRACE_PERIOD, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_KILL_WINDOW_GRACE_PERIOD, REG_DWORD, (void *) NSSM_KILL_WINDOW_GRACE_PERIOD, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_KILL_THREADS_GRACE_PERIOD, REG_DWORD, (void *) NSSM_KILL_THREADS_GRACE_PERIOD, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_KILL_PROCESS_TREE, REG_DWORD, (void *) 1, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_THROTTLE, REG_DWORD, (void *) NSSM_RESET_THROTTLE_RESTART, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_HOOK_SHARE_OUTPUT_HANDLES, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_ROTATE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_ROTATE_ONLINE, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_ROTATE_SECONDS, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_ROTATE_BYTES_LOW, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_ROTATE_BYTES_HIGH, REG_DWORD, 0, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_REG_ROTATE_DELAY, REG_DWORD, (void *) NSSM_ROTATE_DELAY, false, 0, setting_set_number, setting_get_number, 0 },\r
+ { NSSM_NATIVE_DEPENDONGROUP, REG_MULTI_SZ, NULL, true, ADDITIONAL_CRLF, native_set_dependongroup, native_get_dependongroup, native_dump_dependongroup },\r
+ { NSSM_NATIVE_DEPENDONSERVICE, REG_MULTI_SZ, NULL, true, ADDITIONAL_CRLF, native_set_dependonservice, native_get_dependonservice, native_dump_dependonservice },\r
+ { NSSM_NATIVE_DESCRIPTION, REG_SZ, _T(""), true, 0, native_set_description, native_get_description, 0 },\r
+ { NSSM_NATIVE_DISPLAYNAME, REG_SZ, NULL, true, 0, native_set_displayname, native_get_displayname, 0 },\r
+ { NSSM_NATIVE_ENVIRONMENT, REG_MULTI_SZ, NULL, true, ADDITIONAL_CRLF, native_set_environment, native_get_environment, native_dump_environment },\r
+ { NSSM_NATIVE_IMAGEPATH, REG_EXPAND_SZ, NULL, true, 0, native_set_imagepath, native_get_imagepath, setting_not_dumpable },\r
+ { NSSM_NATIVE_OBJECTNAME, REG_SZ, NSSM_LOCALSYSTEM_ACCOUNT, true, 0, native_set_objectname, native_get_objectname, native_dump_objectname },\r
+ { NSSM_NATIVE_NAME, REG_SZ, NULL, true, 0, native_set_name, native_get_name, setting_not_dumpable },\r
+ { NSSM_NATIVE_STARTUP, REG_SZ, NULL, true, 0, native_set_startup, native_get_startup, 0 },\r
+ { NSSM_NATIVE_TYPE, REG_SZ, NULL, true, 0, native_set_type, native_get_type, 0 },\r
{ NULL, NULL, NULL, NULL, NULL }\r
};\r