diff --git a/src/service.rs b/src/service.rs index b5a2075..9dbc4a7 100644 --- a/src/service.rs +++ b/src/service.rs @@ -13,6 +13,7 @@ use windows_sys::{ core::GUID, Win32::{ Foundation::{ERROR_SERVICE_SPECIFIC_ERROR, NO_ERROR}, + Security, Storage::FileSystem, System::{Power, RemoteDesktop, Services, SystemServices, Threading::INFINITE}, UI::WindowsAndMessaging, @@ -80,6 +81,9 @@ bitflags::bitflags! { /// Can use user-defined control codes const USER_DEFINED_CONTROL = Services::SERVICE_USER_DEFINED_CONTROL; + + /// Full access to the service object + const ALL_ACCESS = Services::SERVICE_ALL_ACCESS; } } @@ -1438,6 +1442,11 @@ impl Service { Service { service_handle } } + /// Provides access to the underlying system service handle + pub fn raw_handle(&self) -> Security::SC_HANDLE { + self.service_handle.raw_handle() + } + /// Start the service. /// /// # Example diff --git a/src/service_manager.rs b/src/service_manager.rs index a5f5f74..50a48b7 100644 --- a/src/service_manager.rs +++ b/src/service_manager.rs @@ -21,6 +21,9 @@ bitflags::bitflags! { /// Can enumerate services or receive notifications. const ENUMERATE_SERVICE = Services::SC_MANAGER_ENUMERATE_SERVICE; + + /// Includes all possible access rights. + const ALL_ACCESS = Services::SC_MANAGER_ALL_ACCESS; } }