rendered paste bodyIndex: service.cpp
===================================================================
--- service.cpp (revision 425)
+++ service.cpp (working copy)
@@ -86,6 +86,20 @@
service, // handle to service
SERVICE_CONFIG_DESCRIPTION, // change: description
&sdBuf);
+
+ SC_ACTION _action[1];
+ _action[0].Type = SC_ACTION_RESTART;
+ _action[0].Delay = 10000;
+ SERVICE_FAILURE_ACTIONS sfa;
+ ZeroMemory(&sfa, sizeof(SERVICE_FAILURE_ACTIONS));
+ sfa.lpsaActions = _action;
+ sfa.cActions = 1;
+ sfa.dwResetPeriod =INFINITE;
+ ChangeServiceDescription(
+ service, // handle to service
+ SERVICE_CONFIG_FAILURE_ACTIONS, // information level
+ &sfa); // new data
+
CloseServiceHandle(service);
}
}