X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=registry.cpp;h=c93d3ae1659c83dde348ba6a1c0e5bffb78ac12c;hb=02203cb8aff4be6a094b7a9ded867c3b5d743d77;hp=cc871b7ad68a83076dda91f68db50b9022390830;hpb=4afcd865015c53c91a9cf883bdabde5153f80436;p=nssm.git diff --git a/registry.cpp b/registry.cpp index cc871b7..c93d3ae 100644 --- a/registry.cpp +++ b/registry.cpp @@ -51,6 +51,8 @@ int create_parameters(nssm_service_t *service, bool editing) { } /* Other non-default parameters. May fail. */ + if (service->priority != NORMAL_PRIORITY_CLASS) set_number(key, NSSM_REG_PRIORITY, service->priority); + else if (editing) RegDeleteValue(key, NSSM_REG_PRIORITY); unsigned long stop_method_skip = ~service->stop_method; if (stop_method_skip) set_number(key, NSSM_REG_STOP_METHOD_SKIP, stop_method_skip); else if (editing) RegDeleteValue(key, NSSM_REG_STOP_METHOD_SKIP); @@ -492,6 +494,13 @@ int get_parameters(nssm_service_t *service, STARTUPINFO *si) { } } + /* Try to get priority - may fail. */ + unsigned long priority; + if (get_number(key, NSSM_REG_PRIORITY, &priority) == 1) { + if (priority == (priority & priority_mask())) service->priority = priority; + else log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_BOGUS_PRIORITY, service->name, NSSM_REG_PRIORITY, 0); + } + /* Try to get file rotation settings - may fail. */ unsigned long rotate_files; if (get_number(key, NSSM_REG_ROTATE, &rotate_files, false) == 1) {