diff options
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/service.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/zenutil/include/zenutil/service.h b/src/zenutil/include/zenutil/service.h index cd769b67b..1a0ebc235 100644 --- a/src/zenutil/include/zenutil/service.h +++ b/src/zenutil/include/zenutil/service.h @@ -6,8 +6,16 @@ namespace zen { +enum class ServiceLevel +{ + CurrentUser, + AllUsers, + SystemService +}; + struct ServiceSpec { + ServiceLevel ServiceLevel = ServiceLevel::CurrentUser; std::filesystem::path ExecutablePath; std::string CommandLineOptions; std::string DisplayName; @@ -26,6 +34,9 @@ enum class ServiceStatus Resuming }; +std::string_view ToString(ServiceLevel Level); +std::optional<ServiceLevel> FromString(const std::string& Level); + struct ServiceInfo { ServiceStatus Status; @@ -35,8 +46,8 @@ struct ServiceInfo std::string_view ToString(ServiceStatus Status); std::error_code InstallService(std::string_view ServiceName, const ServiceSpec& Spec); -std::error_code UninstallService(std::string_view ServiceName); +std::error_code UninstallService(std::string_view ServiceName, ServiceLevel Level); std::error_code QueryInstalledService(std::string_view ServiceName, ServiceInfo& OutInfo); -std::error_code StartService(std::string_view ServiceName); -std::error_code StopService(std::string_view ServiceName); +std::error_code StartService(std::string_view ServiceName, ServiceLevel Level); +std::error_code StopService(std::string_view ServiceName, ServiceLevel Level); } // namespace zen |