return 0;\r
}\r
\r
-int set_environment(TCHAR *service_name, HKEY key, TCHAR *value, TCHAR **env, unsigned long *envlen) {\r
+int get_environment(TCHAR *service_name, HKEY key, TCHAR *value, TCHAR **env, unsigned long *envlen) {\r
unsigned long type = REG_MULTI_SZ;\r
\r
/* Dummy test to find buffer size */\r
*env = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, *envlen);\r
if (! *env) {\r
*envlen = 0;\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, value, _T("set_environment()"), 0);\r
+ log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, value, _T("get_environment()"), 0);\r
return 3;\r
}\r
\r
}\r
\r
/* Try to get environment variables - may fail */\r
- set_environment(service->name, key, NSSM_REG_ENV, &service->env, &service->envlen);\r
+ get_environment(service->name, key, NSSM_REG_ENV, &service->env, &service->envlen);\r
/* Environment variables to add to existing rather than replace - may fail. */\r
- set_environment(service->name, key, NSSM_REG_ENV_EXTRA, &service->env_extra, &service->env_extralen);\r
+ get_environment(service->name, key, NSSM_REG_ENV_EXTRA, &service->env_extra, &service->env_extralen);\r
\r
if (si) {\r
if (service->env_extra) {\r
int create_messages();\r
int create_parameters(nssm_service_t *, bool);\r
int create_exit_action(TCHAR *, const TCHAR *, bool);\r
-int set_environment(TCHAR *, HKEY, TCHAR *, TCHAR **, unsigned long *);\r
+int get_environment(TCHAR *, HKEY, TCHAR *, TCHAR **, unsigned long *);\r
int get_string(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool, bool);\r
int get_string(HKEY, TCHAR *, TCHAR *, unsigned long, bool);\r
int expand_parameter(HKEY, TCHAR *, TCHAR *, unsigned long, bool, bool);\r
TCHAR *env = 0;
unsigned long envlen;
- if (set_environment((TCHAR *) service_name, key, (TCHAR *) name, &env, &envlen)) return -1;
+ if (get_environment((TCHAR *) service_name, key, (TCHAR *) name, &env, &envlen)) return -1;
if (! envlen) return 0;
TCHAR *formatted;