X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=registry.cpp;h=228ef8d232fe53a6bce1c5ccc1f8573f186cfb6d;hb=b6f7fe3b11fd130f46eb6b5009391cc3bb0cad49;hp=c0ba8f1568b8ad5d0d67a928db0d4355a472ce35;hpb=1ca188026d2d0b9a379cc1588eee314ca96528ab;p=nssm.git diff --git a/registry.cpp b/registry.cpp index c0ba8f1..228ef8d 100644 --- a/registry.cpp +++ b/registry.cpp @@ -50,7 +50,7 @@ int create_messages() { } /* Get path of this program */ - const TCHAR *path = nssm_imagepath(); + const TCHAR *path = nssm_unquoted_imagepath(); /* Try to register the module but don't worry so much on failure */ RegSetValueEx(key, _T("EventMessageFile"), 0, REG_SZ, (const unsigned char *) path, (unsigned long) (_tcslen(path) + 1) * sizeof(TCHAR)); @@ -189,7 +189,7 @@ int create_parameters(nssm_service_t *service, bool editing) { int create_exit_action(TCHAR *service_name, const TCHAR *action_string, bool editing) { /* Get registry */ TCHAR registry[KEY_LENGTH]; - if (_sntprintf_s(registry, _countof(registry), _TRUNCATE, NSSM_REGISTRY _T("\\%s"), service_name, NSSM_REG_EXIT) < 0) { + if (service_registry_path(service_name, true, NSSM_REG_EXIT, registry, _countof(registry)) < 0) { log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, _T("NSSM_REG_EXIT"), _T("create_exit_action()"), 0); return 1; }