SERVICE_FAILURE_ACTIONS

SERVICE_FAILURE_ACTIONS

The SERVICE_FAILURE_ACTIONS structure represents the action the service controller should take on each failure of a service. A service is considered failed when it terminates without reporting a status of SERVICE_STOPPED to the service controller.

typedef struct _SERVICE_FAILURE_ACTIONS {
DWORD dwResetPeriod;
LPTSTR lpRebootMsg;
LPTSTR lpCommand;
DWORD cActions;
SC_ACTION* lpsaActions; } SERVICE_FAILURE_ACTIONS,
*LPSERVICE_FAILURE_ACTIONS;
Members
dwResetPeriod
Time after which to reset the failure count to zero if there are no failures, in seconds. Specify INFINITE to indicate that this value should never be reset.
lpRebootMsg
Message to broadcast to server users before rebooting in response to the SC_ACTION_REBOOT service controller action.

If this value is NULL, the reboot message is unchanged. If the value is an empty string (""), the reboot message is deleted and no message is broadcast.

lpCommand
Command line of the process for the CreateProcess function to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service.

If this value is NULL, the command is unchanged. If the value is an empty string (""), the command is deleted and no program is run when the service fails.

cActions
Number of elements in the lpsaActions array.

If this value is 0, but lpsaActions is not NULL, the reset period and array of failure actions are deleted.

lpsaActions
Pointer to an array of SC_ACTION structures.

If this value is NULL, the cActions and dwResetPeriod members are ignored.

Remarks

The service control manager 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.

Requirements
ClientRequires Windows XP or Windows 2000 Professional.
ServerRequires Windows Server 2003 or Windows 2000 Server.
Header

Declared in Winsvc.h; include Windows.h.

Unicode

Implemented as SERVICE_FAILURE_ACTIONSW (Unicode) and SERVICE_FAILURE_ACTIONSA (ANSI).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值