From: Iain Patterson Date: Wed, 16 Feb 2011 23:48:31 +0000 (+0000) Subject: Use GetWindowsDirectory() instead of %SYSTEMROOT%. X-Git-Tag: v2.8~8 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=1a0589979826c8388941f753b58ec7f437a3c247;p=nssm.git Use GetWindowsDirectory() instead of %SYSTEMROOT%. Though unlikely, it's possible that %SYSTEMROOT% might be undefined. --- diff --git a/registry.cpp b/registry.cpp index 0471ca7..f82e1bf 100644 --- a/registry.cpp +++ b/registry.cpp @@ -180,7 +180,7 @@ int get_parameters(char *service_name, char *exe, int exelen, char *flags, int f } else { /* Help! */ - unsigned long ret = ExpandEnvironmentStrings("%SYSTEMROOT%", dir, dirlen); + unsigned long ret = GetWindowsDirectory(dir, dirlen); if (! ret || ret > dirlen) { log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_NO_DIR_AND_NO_FALLBACK, NSSM_REG_DIR, service_name, 0); RegCloseKey(key);