mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-03 00:23:24 +01:00
Added Method to check if a service is stopped
This commit is contained in:
@@ -164,6 +164,15 @@ bool WinService::isRunning() const
|
||||
return ss.dwCurrentState == SERVICE_RUNNING;
|
||||
}
|
||||
|
||||
bool WinService::isStopped() const
|
||||
{
|
||||
open();
|
||||
SERVICE_STATUS ss;
|
||||
if (!QueryServiceStatus(_svcHandle, &ss))
|
||||
throw SystemException("cannot query service status", _name);
|
||||
return ss.dwCurrentState == SERVICE_STOPPED;
|
||||
}
|
||||
|
||||
|
||||
void WinService::start()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user