Le service %1 a reçu le code de contrôle inconnu %2, qui sera donc ignoré.
.
+MessageId = +1
+SymbolicName = NSSM_EVENT_CHANGESERVICECONFIG2_FAILED
+Severity = Informational
+Language = English
+Error configuring service failure actions for service %1. The service will not be subject to recovery actions if it exits gracefully with a non-zero exit code.
+ChangeServiceConfig2() failed:
+%2
+.
+Language = French
+Erreur lors de la configuration des actions en cas d'échec du service %1. Le service ne déclenchera aucune action de récupération s'il se termine normalement avec un code retour non nul.
+ChangeServiceConfig2() a échoué:
+.
+
\r
SC_HANDLE service = OpenService(services, service_name, SC_MANAGER_ALL_ACCESS);\r
if (! service) return;\r
- return;\r
\r
SERVICE_FAILURE_ACTIONS_FLAG flag;\r
ZeroMemory(&flag, sizeof(flag));\r
flag.fFailureActionsOnNonCrashFailures = true;\r
\r
/* This functionality was added in Vista so the call may fail */\r
- ChangeServiceConfig2(service, SERVICE_CONFIG_FAILURE_ACTIONS_FLAG, &flag);\r
+ if (! ChangeServiceConfig2(service, SERVICE_CONFIG_FAILURE_ACTIONS_FLAG, &flag)) {\r
+ unsigned long error = GetLastError();\r
+ /* Pre-Vista we expect to fail with ERROR_INVALID_LEVEL */\r
+ if (error != ERROR_INVALID_LEVEL) {\r
+ log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_CHANGESERVICECONFIG2_FAILED, service_name, error_string(error), 0);\r
+ }\r
+ }\r
}\r
\r
int monitor_service() {\r