}\r
\r
/* Try to get throttle restart delay */\r
- unsigned long type = REG_DWORD;\r
- unsigned long buflen = sizeof(*throttle_delay);\r
- bool throttle_ok = false;\r
- ret = RegQueryValueEx(key, NSSM_REG_THROTTLE, 0, &type, (unsigned char *) throttle_delay, &buflen);\r
- if (ret != ERROR_SUCCESS) {\r
- if (ret != ERROR_FILE_NOT_FOUND) {\r
- if (type != REG_DWORD) {\r
- char milliseconds[16];\r
- _snprintf_s(milliseconds, sizeof(milliseconds), _TRUNCATE, "%lu", NSSM_RESET_THROTTLE_RESTART);\r
- log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_BOGUS_THROTTLE, service_name, NSSM_REG_THROTTLE, milliseconds, 0);\r
- }\r
- else log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_QUERYVALUE_FAILED, NSSM_REG_THROTTLE, error_string(GetLastError()), 0);\r
- }\r
- }\r
- else throttle_ok = true;\r
-\r
- if (! throttle_ok) *throttle_delay = NSSM_RESET_THROTTLE_RESTART;\r
+ override_milliseconds(service_name, key, NSSM_REG_THROTTLE, throttle_delay, NSSM_RESET_THROTTLE_RESTART, NSSM_EVENT_BOGUS_THROTTLE);\r
\r
/* Try to get service stop flags. */\r
- type = REG_DWORD;\r
+ unsigned long type = REG_DWORD;\r
unsigned long stop_method_skip;\r
- buflen = sizeof(stop_method_skip);\r
+ unsigned long buflen = sizeof(stop_method_skip);\r
bool stop_ok = false;\r
ret = RegQueryValueEx(key, NSSM_REG_STOP_METHOD_SKIP, 0, &type, (unsigned char *) &stop_method_skip, &buflen);\r
if (ret != ERROR_SUCCESS) {\r