forked from chrisoldwood/WMI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWin32_Service.cpp
More file actions
55 lines (39 loc) · 1.35 KB
/
Win32_Service.cpp
File metadata and controls
55 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
////////////////////////////////////////////////////////////////////////////////
//! \file Win32_Service.cpp
//! \brief The Win32_Service class definition.
//! \author Chris Oldwood
#include "Common.hpp"
#include "Win32_Service.hpp"
namespace WMI
{
//! The WMI class name this type mirrors.
const tchar* Win32_Service::WMI_CLASS_NAME = TXT("Win32_Service");
////////////////////////////////////////////////////////////////////////////////
//! Construction from the underlying COM object and connection.
Win32_Service::Win32_Service(IWbemClassObjectPtr object, const Connection& connection)
: TypedObject<Win32_Service>(object, connection)
{
}
////////////////////////////////////////////////////////////////////////////////
//! Destructor.
Win32_Service::~Win32_Service()
{
}
////////////////////////////////////////////////////////////////////////////////
//! Start the service.
uint32 Win32_Service::StartService()
{
WCL::Variant returnValue;
execMethod(TXT("StartService"), returnValue);
return WCL::getValue<uint32>(WCL::Variant(returnValue, VT_UI4));
}
////////////////////////////////////////////////////////////////////////////////
//! Stop the service.
uint32 Win32_Service::StopService()
{
WCL::Variant returnValue;
execMethod(TXT("StopService"), returnValue);
return WCL::getValue<uint32>(WCL::Variant(returnValue, VT_UI4));
}
//namespace WMI
}