xentara-utils v2.0.4
The Xentara Utility Library
Loading...
Searching...
No Matches
xentara::utils::windows::wmi::Locator Class Referencefinal

A locator for WMI services. More...

#include <xentara/utils/windows/wmi/Locator.hpp>

+ Inheritance diagram for xentara::utils::windows::wmi::Locator:

Public Member Functions

 Locator ()
 Constructor.
 
internal auto connect (const wchar_t *wmiNamespace=L"CIMv2") const -> Namespace
 Connects to a local namespace.
 

Detailed Description

A locator for WMI services.

Creates a locator object that can be used to connect to the Windows Management Intrumentation (WMI) service on the local machine.

Attention
WMI uses the Windows Component Object Model (COM). This class will initialize a COM thread environment using the COINIT_APARTMENTTHREADED concurrency model. The thread invironment is uninitialized again in the constructor.
See also
com::ThreadEnvironment

Constructor & Destructor Documentation

◆ Locator()

xentara::utils::windows::wmi::Locator::Locator ( )

Constructor.

This constructor initializes the COM thread environment needed to communicate with the WMI service. The thread environment uses the the COINIT_APARTMENTTHREADED concurrency model.

Exceptions
std::runtime_errorThe COM thread environment nedded could not be initialized

Member Function Documentation

◆ connect()

internal auto xentara::utils::windows::wmi::Locator::connect ( const wchar_t *  wmiNamespace = L"CIMv2") const -> Namespace

Connects to a local namespace.

Exceptions
std::runtime_errorAn error occurred trying to connect to the namespace