3 #define SERVICE_CONTROL_START 0
18 void Open(
const ServiceManager& scm,
const std::wstring& name, DWORD access = SERVICE_ALL_ACCESS);
26 bool IsOpen()
const {
return m_h != NULL; }
57 bool Wait(DWORD timeout = INFINITE)
const;
bool Wait(DWORD timeout=INFINITE) const
wait for a transition to complete while the service is pausing, starting, stopping, etc.
Definition: ServiceInstance.cpp:160
DWORD GetServiceState() const
return the service state
Definition: ServiceInstance.cpp:130
void Control(DWORD control)
control a service
Definition: ServiceInstance.cpp:86
service creation information
Definition: ServiceCreateInfo.h:8
bool IsStopped() const
returns true if the service is stopped
Definition: ServiceInstance.h:50
void Pause()
pause a service
Definition: ServiceInstance.cpp:120
void Close()
close a previously opened service object
Definition: ServiceInstance.cpp:19
void Delete()
delete the service
Definition: ServiceInstance.cpp:39
ServiceConfig GetConfig() const
get service configuration
Definition: ServiceInstance.cpp:208
void Start()
start a service
Definition: ServiceInstance.cpp:109
std::wstring GetDescription() const
get service description
Definition: ServiceInstance.cpp:184
std::wstring GetServiceStateString()
return string presentation of the service state
Definition: ServiceInstance.cpp:137
void GetServiceProcessStatus(LPSERVICE_STATUS_PROCESS) const
return process information
Definition: ServiceInstance.cpp:76
virtual ~ServiceInstance()
Definition: ServiceInstance.cpp:11
void Create(const ServiceManager &scm, const ServiceCreateInfo &info)
create a new service
Definition: ServiceInstance.cpp:50
SC_HANDLE GetHandle() const
return the service handle
Definition: ServiceInstance.h:28
void Continue()
continue (resume) a service
Definition: ServiceInstance.cpp:125
Service manager.
Definition: ServiceManager.h:8
void Stop()
stop a service
Definition: ServiceInstance.cpp:104
void Open(const ServiceManager &scm, const std::wstring &name, DWORD access=SERVICE_ALL_ACCESS)
open the service instance object
Definition: ServiceInstance.cpp:27
service configuration
Definition: ServiceConfig.h:8
ServiceInstance()
Definition: ServiceInstance.cpp:6
a service instance
Definition: ServiceInstance.h:10
void Restart()
restart a service
Definition: ServiceInstance.cpp:114
bool IsPaused() const
returns true if the service is paused
Definition: ServiceInstance.h:52
bool IsOpen() const
returns true if service is already open
Definition: ServiceInstance.h:26
bool IsStarted() const
returns true if the service is started
Definition: ServiceInstance.h:48