Browse Source

Use GetWindowsDirectory() instead of %SYSTEMROOT%.

Though unlikely, it's possible that %SYSTEMROOT% might be undefined.
Iain Patterson 13 years ago
parent
commit
1a05899798
1 changed files with 1 additions and 1 deletions
  1. 1 1
      registry.cpp

+ 1 - 1
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);