WMI_Helper
WMI_Helper

WMI_Helper makes it simple to interface and request information from the WMI.

Types
wmiValue

A map of string property names to their VARIANT values

wmiValues

A vector of wmiValue maps

Functions
WMI_Helper
WMI_Helper(
std::string wmi_namespace,
std::string wmi_class
)

Creates a WMI_Helper object

Parameters
wmi_namespace
std::string

The string name of the WMI Namespace (ie. "root\\CIMV2\\Applications\\Games")

wmi_class
std::string

The string name of the WMI Class (ie. "Game")

Exceptions
std::exception

Thrown if any errors occur during the connect stage

WMI_Helper
~WMI_Helper()

Destroys the WMI_Helper object

request
wmiValues request(
std::vector<std::stringvaluesToGet
)

Starts a request for information received from WMI

Parameters
valuesToGet
std::vector<std::string>

A vector of strings to request from the namespace and class that was given at construction time

Returns

A vector containing a map for each found item, with each map containing a parameter-value pair

Exceptions
std::exception

Thrown if any errors occur, including if the values that were requested were incorrect

connect
void connect()

Connects and retrieves information from the WMI namespace and class that was given at construction time

Exceptions
std::exception

Thrown if any errors occur, including if the namespace or class are incorrect

Variables
m_wmi_namespace
std::string m_wmi_namespace

The WMI namespace that this is using

m_wmi_class
std::string m_wmi_class

The WMI class that this is using

m_enumerator
IEnumWbemClassObject* m_enumerator

The enumerator that holds all the information internally from the request