pub struct ServiceFailureActions {
pub reset_period: ServiceFailureResetPeriod,
pub reboot_msg: Option<OsString>,
pub command: Option<OsString>,
pub actions: Option<Vec<ServiceAction>>,
}Expand description
A struct that describes the action that should be performed on the system service crash.
Please refer to MSDN for more info:
https://docs.microsoft.com/en-us/windows/win32/api/winsvc/ns-winsvc-_service_failure_actionsw
Fields§
§reset_period: ServiceFailureResetPeriodThe time after which to reset the failure count to zero if there are no failures, in seconds.
reboot_msg: Option<OsString>The message to be broadcast to server users before rebooting in response to the
SC_ACTION_REBOOT service controller action.
If this value is None, the reboot message is unchanged.
If the value is an empty string, the reboot message is deleted and no message is broadcast.
command: Option<OsString>The command line 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 None, the command is unchanged. If the value is an empty string, the
command is deleted and no program is run when the service fails.
actions: Option<Vec<ServiceAction>>The array of actions to perform.
If this value is None, the ServiceFailureActions::reset_period member is ignored.
Implementations§
Source§impl ServiceFailureActions
impl ServiceFailureActions
Sourcepub unsafe fn from_raw(
raw: SERVICE_FAILURE_ACTIONSW,
) -> Result<ServiceFailureActions>
pub unsafe fn from_raw( raw: SERVICE_FAILURE_ACTIONSW, ) -> Result<ServiceFailureActions>
Tries to parse a SERVICE_FAILURE_ACTIONSW into Rust ServiceFailureActions.
§Errors
Returns an error if any of the SC_ACTIONs pointed to by lpsaActions does not
successfully convert into a ServiceAction.
§Safety
The SERVICE_FAILURE_ACTIONSW fields lpRebootMsg, lpCommand must be either null
or proper null terminated wide C strings.
lpsaActions must be either null or an array with cActions number of of SC_ACTIONs.
Trait Implementations§
Source§impl Clone for ServiceFailureActions
impl Clone for ServiceFailureActions
Source§fn clone(&self) -> ServiceFailureActions
fn clone(&self) -> ServiceFailureActions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more