From: Iain Patterson Date: Tue, 14 Jan 2014 23:05:58 +0000 (+0000) Subject: Don't expand parameters when querying a service. X-Git-Tag: v2.22~52 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=97d5ee74502bad595227da76c8d230ec54f2cbb3;p=nssm.git Don't expand parameters when querying a service. Calling, eg "nssm get Application" should print the unexpanded string from the registry. --- diff --git a/settings.cpp b/settings.cpp index 3f01047..c9bb32d 100644 --- a/settings.cpp +++ b/settings.cpp @@ -101,7 +101,7 @@ static int setting_get_string(const TCHAR *service_name, void *param, const TCHA HKEY key = (HKEY) param; TCHAR buffer[VALUE_LENGTH]; - if (expand_parameter(key, (TCHAR *) name, (TCHAR *) buffer, (unsigned long) sizeof(buffer), false, false)) return -1; + if (get_string(key, (TCHAR *) name, (TCHAR *) buffer, (unsigned long) sizeof(buffer), false, false, false)) return -1; return value_from_string(name, value, buffer); } @@ -266,7 +266,7 @@ static int setting_get_affinity(const TCHAR *service_name, void *param, const TC return -1; } - if (expand_parameter(key, (TCHAR *) name, buffer, buflen, false, true)) { + if (get_string(key, (TCHAR *) name, buffer, buflen, false, false, true)) { HeapFree(GetProcessHeap(), 0, buffer); return -1; }