2.2.39 SERVICE_FAILURE_ACTIONSA

The SERVICE_FAILURE_ACTIONSA structure defines the action that the service controller takes on each failure of a service. String values are stored in ANSI.

 typedef struct _SERVICE_FAILURE_ACTIONSA {
   DWORD dwResetPeriod;
   [string, range(0, 8 * 1024)] LPSTR lpRebootMsg;
   [string, range(0, 8 * 1024)] LPSTR lpCommand;
   [range(0, 1024)] DWORD cActions;
   [size_is(cActions)] SC_ACTION* lpsaActions;
 } SERVICE_FAILURE_ACTIONSA,
  *LPSERVICE_FAILURE_ACTIONSA;

dwResetPeriod: The time, in seconds, after which to reset the failure count to zero if there are no failures.

lpRebootMsg: The buffer that contains the message to be broadcast to server users before rebooting in response to the SC_ACTION_REBOOT service controller action.

lpCommand: The buffer that contains the command line of the process for the process creation function to execute in response to the SC_ACTION_RUN_COMMAND service controller action.

cActions: The number of elements in the lpsaActions array.

lpsaActions: A pointer to an array of SC_ACTION (section 2.2.19) structures.

The service controller counts the number of times each service has failed since the system booted. The count is reset to 0 if the service has not failed for dwResetPeriod seconds. When the service fails for the Nth time, the service controller performs the action specified in element [N-1] of the lpsaActions array. If N is greater than cActions, the service controller repeats the last action in the array.