}\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
return 3;\r
}\r
\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