pub struct ServiceConfig {
pub service_type: ServiceType,
pub start_type: ServiceStartType,
pub error_control: ServiceErrorControl,
pub executable_path: PathBuf,
pub load_order_group: Option<OsString>,
pub tag_id: u32,
pub dependencies: Vec<ServiceDependency>,
pub account_name: Option<OsString>,
pub display_name: OsString,
}Expand description
A struct that describes the service.
Fields§
§service_type: ServiceTypeThe service type
start_type: ServiceStartTypeThe service startup options
error_control: ServiceErrorControlThe severity of the error, and action taken, if this service fails to start.
executable_path: PathBufPath to the service binary
load_order_group: Option<OsString>Path to the service binary
tag_id: u32A unique tag value for this service in the group specified by the load_order_group parameter.
dependencies: Vec<ServiceDependency>Service dependencies
account_name: Option<OsString>Account to use for running the service. for example: NT Authority\System.
This value can be None in certain cases, please refer to MSDN for more info:
https://docs.microsoft.com/en-us/windows/desktop/api/winsvc/ns-winsvc-_query_service_configw
display_name: OsStringUser-friendly service name
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
Sourcepub unsafe fn from_raw(raw: QUERY_SERVICE_CONFIGW) -> Result<ServiceConfig>
pub unsafe fn from_raw(raw: QUERY_SERVICE_CONFIGW) -> Result<ServiceConfig>
Tries to parse a QUERY_SERVICE_CONFIGW into Rust ServiceConfig.
§Errors
Returns an error if dwStartType does not successfully convert into a
ServiceStartType, or dwErrorControl does not successfully convert
into a ServiceErrorControl.
§Safety
lpDependencies must contain a wide string where each dependency is delimited with a NUL
and the entire string ends in two NULs.
lpLoadOrderGroup, lpServiceStartName, lpBinaryPathName and lpDisplayName must be
either null or proper null terminated wide C strings.
Trait Implementations§
Source§impl Clone for ServiceConfig
impl Clone for ServiceConfig
Source§fn clone(&self) -> ServiceConfig
fn clone(&self) -> ServiceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more