}\r
log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_STARTED_SERVICE, exe, flags, service_name, dir, 0);\r
\r
}\r
log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_STARTED_SERVICE, exe, flags, service_name, dir, 0);\r
\r
if (! RegisterWaitForSingleObject(&wait_handle, process_handle, end_service, (void *) pid, INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTELONGFUNCTION)) {\r
log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_REGISTERWAITFORSINGLEOBJECT_FAILED, service_name, exe, error_string(GetLastError()), 0);\r
}\r
if (! RegisterWaitForSingleObject(&wait_handle, process_handle, end_service, (void *) pid, INFINITE, WT_EXECUTEONLYONCE | WT_EXECUTELONGFUNCTION)) {\r
log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_REGISTERWAITFORSINGLEOBJECT_FAILED, service_name, exe, error_string(GetLastError()), 0);\r
}\r
/* "0x" + 8 x hex + NULL */\r
text = (char *) HeapAlloc(GetProcessHeap(), 0, 11);\r
if (! text) {\r
/* "0x" + 8 x hex + NULL */\r
text = (char *) HeapAlloc(GetProcessHeap(), 0, 11);\r
if (! text) {\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, "control code", "log_service_control", 0);\r
+ log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, "control code", "log_service_control()", 0);\r
return;\r
}\r
if (_snprintf_s(text, 11, _TRUNCATE, "0x%08x", control) < 0) {\r
return;\r
}\r
if (_snprintf_s(text, 11, _TRUNCATE, "0x%08x", control) < 0) {\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, "control code", "log_service_control", 0);\r
+ log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, "control code", "log_service_control()", 0);\r
- _snprintf_s(code, sizeof(code), _TRUNCATE, "%d", exitcode);\r
+ _snprintf_s(code, sizeof(code), _TRUNCATE, "%lu", exitcode);\r
log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_ENDED_SERVICE, exe, service_name, code, 0);\r
}\r
\r
/* Clean up. */\r
log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_ENDED_SERVICE, exe, service_name, code, 0);\r
}\r
\r
/* Clean up. */\r
kill_process_tree(service_name, stop_method, pid, exitcode, pid, &creation_time, &exit_time);\r
\r
/*\r
kill_process_tree(service_name, stop_method, pid, exitcode, pid, &creation_time, &exit_time);\r
\r
/*\r
if (throttle > 7) throttle = 8;\r
\r
char threshold[8], milliseconds[8];\r
if (throttle > 7) throttle = 8;\r
\r
char threshold[8], milliseconds[8];\r
- _snprintf_s(threshold, sizeof(threshold), _TRUNCATE, "%d", throttle_delay);\r
- _snprintf_s(milliseconds, sizeof(milliseconds), _TRUNCATE, "%d", ms);\r
+ _snprintf_s(threshold, sizeof(threshold), _TRUNCATE, "%lu", throttle_delay);\r
+ _snprintf_s(milliseconds, sizeof(milliseconds), _TRUNCATE, "%lu", ms);\r
log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_THROTTLED, service_name, threshold, milliseconds, 0);\r
\r
if (use_critical_section) EnterCriticalSection(&throttle_section);\r
log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_THROTTLED, service_name, threshold, milliseconds, 0);\r
\r
if (use_critical_section) EnterCriticalSection(&throttle_section);\r