From 1a0589979826c8388941f753b58ec7f437a3c247 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 16 Feb 2011 23:48:31 +0000 Subject: [PATCH] Use GetWindowsDirectory() instead of %SYSTEMROOT%. Though unlikely, it's possible that %SYSTEMROOT% might be undefined. --- registry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.7.4