All pastes #811916 Raw Edit

Something

public text v1 · immutable
·published 2007-12-11 10:10 UTC
rendered paste body
Index: 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);
 			}
 		}