Skip to content

Latest commit

 

History

History
154 lines (92 loc) · 6.15 KB

ns-winsvc-service_failure_actionsa.md

File metadata and controls

154 lines (92 loc) · 6.15 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NS:winsvc._SERVICE_FAILURE_ACTIONSA
SERVICE_FAILURE_ACTIONSA (winsvc.h)
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. (ANSI)
*LPSERVICE_FAILURE_ACTIONSA
LPSERVICE_FAILURE_ACTIONS
LPSERVICE_FAILURE_ACTIONS structure pointer
SERVICE_FAILURE_ACTIONS
SERVICE_FAILURE_ACTIONS structure
SERVICE_FAILURE_ACTIONSA
SERVICE_FAILURE_ACTIONSW
_win32_service_failure_actions_str
base.service_failure_actions_str
winsvc/LPSERVICE_FAILURE_ACTIONS
winsvc/SERVICE_FAILURE_ACTIONS
winsvc/SERVICE_FAILURE_ACTIONSA
winsvc/SERVICE_FAILURE_ACTIONSW
base\service_failure_actions_str.htm
security
180ca6d9-f2c3-4ea1-b2c6-319d08ef88ee
12/05/2018
*LPSERVICE_FAILURE_ACTIONSA, LPSERVICE_FAILURE_ACTIONS, LPSERVICE_FAILURE_ACTIONS structure pointer, SERVICE_FAILURE_ACTIONS, SERVICE_FAILURE_ACTIONS structure, SERVICE_FAILURE_ACTIONSA, SERVICE_FAILURE_ACTIONSW, _win32_service_failure_actions_str, base.service_failure_actions_str, winsvc/LPSERVICE_FAILURE_ACTIONS, winsvc/SERVICE_FAILURE_ACTIONS, winsvc/SERVICE_FAILURE_ACTIONSA, winsvc/SERVICE_FAILURE_ACTIONSW
winsvc.h
Windows.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
SERVICE_FAILURE_ACTIONSW (Unicode) and SERVICE_FAILURE_ACTIONSA (ANSI)
Windows
SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA
19H1
_SERVICE_FAILURE_ACTIONSA
winsvc/_SERVICE_FAILURE_ACTIONSA
LPSERVICE_FAILURE_ACTIONSA
winsvc/LPSERVICE_FAILURE_ACTIONSA
SERVICE_FAILURE_ACTIONSA
winsvc/SERVICE_FAILURE_ACTIONSA
c++
APIRef
kbSyntax
HeaderDef
Winsvc.h
SERVICE_FAILURE_ACTIONS
SERVICE_FAILURE_ACTIONSA
SERVICE_FAILURE_ACTIONSW

SERVICE_FAILURE_ACTIONSA structure

-description

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.

To configure additional circumstances under which the failure actions are to be executed, see SERVICE_FAILURE_ACTIONS_FLAG.

-struct-fields

-field dwResetPeriod

The 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.

-field lpRebootMsg

The message to be 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.

This member can specify a localized string using the following format:

@[path]dllname,-strID

The string with identifier strID is loaded from dllname; the path is optional. For more information, see RegLoadMUIString.

Windows Server 2003 and Windows XP:  Localized strings are not supported until Windows Vista.

-field lpCommand

The 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.

-field cActions

The 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.

-field cActions.range

-field cActions.range.0

-field cActions.range.1024

-field lpsaActions

A pointer to an array of SC_ACTION structures.

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

-field lpsaActions.size_is

-field lpsaActions.size_is.cActions

-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.

Note

The winsvc.h header defines SERVICE_FAILURE_ACTIONS as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

ChangeServiceConfig2

CreateProcess

QueryServiceConfig2

SC_ACTION

SERVICE_FAILURE_ACTIONS_FLAG