When editing or deleting a service we get the service information using the
name provided by the user. The name is case-insensitive but case-preserving.
Use GetServiceKeyName() to retrieve the canonical name and display that
in any messages containing the service name.
}\r
_sntprintf_s(service->displayname, _countof(service->displayname), _TRUNCATE, _T("%s"), qsc->lpDisplayName);\r
\r
}\r
_sntprintf_s(service->displayname, _countof(service->displayname), _TRUNCATE, _T("%s"), qsc->lpDisplayName);\r
\r
+ /* Get the canonical service name. We open it case insensitively. */\r
+ bufsize = _countof(service->name);\r
+ GetServiceKeyName(services, service->displayname, service->name, &bufsize);\r
+\r
/* Remember the executable in case it isn't NSSM. */\r
_sntprintf_s(service->image, _countof(service->image), _TRUNCATE, _T("%s"), qsc->lpBinaryPathName);\r
HeapFree(GetProcessHeap(), 0, qsc);\r
/* Remember the executable in case it isn't NSSM. */\r
_sntprintf_s(service->image, _countof(service->image), _TRUNCATE, _T("%s"), qsc->lpBinaryPathName);\r
HeapFree(GetProcessHeap(), 0, qsc);\r
+ /* Get the canonical service name. We open it case insensitively. */\r
+ unsigned long bufsize = _countof(service->displayname);\r
+ GetServiceDisplayName(services, service->name, service->displayname, &bufsize);\r
+ bufsize = _countof(service->name);\r
+ GetServiceKeyName(services, service->displayname, service->name, &bufsize);\r
+\r
/* Try to delete the service */\r
if (! DeleteService(service->handle)) {\r
print_message(stderr, NSSM_MESSAGE_DELETESERVICE_FAILED);\r
/* Try to delete the service */\r
if (! DeleteService(service->handle)) {\r
print_message(stderr, NSSM_MESSAGE_DELETESERVICE_FAILED);\r