KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIPLATFORM::SYSINFO Class Reference

#include <sysinfo_gtk.h>

Inheritance diagram for KIPLATFORM::SYSINFO:
KIPLATFORM::SYSINFO_BASE KIPLATFORM::SYSINFO_BASE KIPLATFORM::SYSINFO_BASE

Public Member Functions

 SYSINFO ()
 
 ~SYSINFO ()
 
bool GetCPUInfo (std::vector< CPU_INFO > &aCpuInfos) override
 Retrieve CPU info for the system.
 
bool GetGPUInfo (std::vector< GPU_INFO > &aGpuInfos) override
 Retrieve GPU info for the system.
 
bool GetMemoryInfo (MEMORY_INFO &aRamInfo) override
 Retrieve memory info for the system.
 
 SYSINFO ()
 
 ~SYSINFO ()
 
bool GetCPUInfo (std::vector< CPU_INFO > &aCpuInfos) override
 Retrieve CPU info for the system.
 
bool GetGPUInfo (std::vector< GPU_INFO > &aGpuInfos) override
 Retrieve GPU info for the system.
 
bool GetMemoryInfo (MEMORY_INFO &aMemoryInfo) override
 Retrieve memory info for the system.
 
 SYSINFO ()
 
 ~SYSINFO ()
 
bool GetCPUInfo (std::vector< CPU_INFO > &aCpuInfos) override
 Retrieve CPU info for the system.
 
bool GetGPUInfo (std::vector< GPU_INFO > &aGpuInfos) override
 Retrieve GPU info for the system.
 
bool GetMemoryInfo (MEMORY_INFO &aMemoryInfo) override
 Retrieve memory info for the system.
 

Private Member Functions

HRESULT openWmi ()
 
HRESULT freeWmi ()
 
bool gpuFromDirectX (std::vector< GPU_INFO > &aGpuInfos)
 Fetche gpu info from directx and registry.
 
bool getVersionFromDXRegistry (int64_t aAdapterLuid, std::string &aDriverVersion)
 Extract the driver version for an adapter from the directx section of the registry.
 
std::string improveDriverVersion (const std::string &aManufacturer, const std::string &aVersion)
 Attempt to convert the Windows driver version string to the vendor version string if possible.
 
void variantToString (const LPVARIANT aVar, std::string &aReturnString) const
 Convert a win32 LPVARIANT to a string.
 

Private Attributes

IWbemLocator * m_pLoc = nullptr
 
IWbemServices * m_pSvc = nullptr
 
IEnumWbemClassObject * m_pEnumerator = nullptr
 
IWbemClassObject * m_pClassObject = nullptr
 

Detailed Description

Definition at line 25 of file sysinfo_gtk.h.

Constructor & Destructor Documentation

◆ SYSINFO() [1/3]

KIPLATFORM::SYSINFO::SYSINFO ( )

Definition at line 23 of file apple/sysinfo.cpp.

◆ ~SYSINFO() [1/3]

KIPLATFORM::SYSINFO::~SYSINFO ( )

Definition at line 27 of file apple/sysinfo.cpp.

◆ SYSINFO() [2/3]

KIPLATFORM::SYSINFO::SYSINFO ( )

◆ ~SYSINFO() [2/3]

KIPLATFORM::SYSINFO::~SYSINFO ( )

◆ SYSINFO() [3/3]

KIPLATFORM::SYSINFO::SYSINFO ( )

◆ ~SYSINFO() [3/3]

KIPLATFORM::SYSINFO::~SYSINFO ( )

Member Function Documentation

◆ freeWmi()

HRESULT KIPLATFORM::SYSINFO::freeWmi ( )
private

Definition at line 161 of file windows/sysinfo.cpp.

References m_pEnumerator, m_pLoc, and m_pSvc.

◆ GetCPUInfo() [1/3]

bool KIPLATFORM::SYSINFO::GetCPUInfo ( std::vector< CPU_INFO > & aCpuInfos)
overridevirtual

Retrieve CPU info for the system.

Parameters
aCpuInfosis an vector for CPU_INFO objects to be stored in
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

Definition at line 36 of file apple/sysinfo.cpp.

◆ GetCPUInfo() [2/3]

bool KIPLATFORM::SYSINFO::GetCPUInfo ( std::vector< CPU_INFO > & aCpuInfos)
overridevirtual

Retrieve CPU info for the system.

Parameters
aCpuInfosis an vector for CPU_INFO objects to be stored in
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

◆ GetCPUInfo() [3/3]

bool KIPLATFORM::SYSINFO::GetCPUInfo ( std::vector< CPU_INFO > & aCpuInfos)
overridevirtual

Retrieve CPU info for the system.

Parameters
aCpuInfosis an vector for CPU_INFO objects to be stored in
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

◆ GetGPUInfo() [1/3]

bool KIPLATFORM::SYSINFO::GetGPUInfo ( std::vector< GPU_INFO > & aGpuInfos)
overridevirtual

Retrieve GPU info for the system.

Parameters
aGpuInfosis an vector for GPU_INFO objects to be stored in
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

Definition at line 41 of file apple/sysinfo.cpp.

◆ GetGPUInfo() [2/3]

bool KIPLATFORM::SYSINFO::GetGPUInfo ( std::vector< GPU_INFO > & aGpuInfos)
overridevirtual

Retrieve GPU info for the system.

Parameters
aGpuInfosis an vector for GPU_INFO objects to be stored in
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

◆ GetGPUInfo() [3/3]

bool KIPLATFORM::SYSINFO::GetGPUInfo ( std::vector< GPU_INFO > & aGpuInfos)
overridevirtual

Retrieve GPU info for the system.

Parameters
aGpuInfosis an vector for GPU_INFO objects to be stored in
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

◆ GetMemoryInfo() [1/3]

bool KIPLATFORM::SYSINFO::GetMemoryInfo ( MEMORY_INFO & aMemoryInfo)
overridevirtual

Retrieve memory info for the system.

Parameters
aMemoryInfois an object to be populate with the retrieved system memory info
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

◆ GetMemoryInfo() [2/3]

bool KIPLATFORM::SYSINFO::GetMemoryInfo ( MEMORY_INFO & aMemoryInfo)
overridevirtual

Retrieve memory info for the system.

Parameters
aMemoryInfois an object to be populate with the retrieved system memory info
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

◆ GetMemoryInfo() [3/3]

bool KIPLATFORM::SYSINFO::GetMemoryInfo ( MEMORY_INFO & aMemoryInfo)
overridevirtual

Retrieve memory info for the system.

Parameters
aMemoryInfois an object to be populate with the retrieved system memory info
Returns
true if info was fetchable, false if failure to retrieve info

Implements KIPLATFORM::SYSINFO_BASE.

Definition at line 31 of file apple/sysinfo.cpp.

◆ getVersionFromDXRegistry()

bool KIPLATFORM::SYSINFO::getVersionFromDXRegistry ( int64_t aAdapterLuid,
std::string & aDriverVersion )
private

Extract the driver version for an adapter from the directx section of the registry.

Parameters
aAdapterLuidis the unique adapter (gpu) id to look for in the registry.
aDriverVersionis the string variable that will be updated.
Returns
True if successfully retrieved the driver version.

Definition at line 311 of file windows/sysinfo.cpp.

References index, and L.

Referenced by gpuFromDirectX().

◆ gpuFromDirectX()

bool KIPLATFORM::SYSINFO::gpuFromDirectX ( std::vector< GPU_INFO > & aGpuInfos)
private

Fetche gpu info from directx and registry.

WMI unfortunately has a uint32 max value issue for reporting gpu memory, meanwhile directx does not have this issue. We only lightly poke directx to get the info we need and don't actually use it.

Definition at line 387 of file windows/sysinfo.cpp.

References KIPLATFORM::GPU_INFO::DriverVersion, getVersionFromDXRegistry(), improveDriverVersion(), L, KIPLATFORM::GPU_INFO::Manufacturer, KIPLATFORM::GPU_INFO::MemorySize, and KIPLATFORM::GPU_INFO::Name.

◆ improveDriverVersion()

std::string KIPLATFORM::SYSINFO::improveDriverVersion ( const std::string & aManufacturer,
const std::string & aVersion )
private

Attempt to convert the Windows driver version string to the vendor version string if possible.

Parameters
aManufactureris the name of the vendor.
aVersionis the windows driver version string to convert.
Returns
Vendor version string.

Definition at line 184 of file windows/sysinfo.cpp.

Referenced by gpuFromDirectX().

◆ openWmi()

HRESULT KIPLATFORM::SYSINFO::openWmi ( )
private

Definition at line 105 of file windows/sysinfo.cpp.

References m_pLoc, and m_pSvc.

◆ variantToString()

void KIPLATFORM::SYSINFO::variantToString ( const LPVARIANT aVar,
std::string & aReturnString ) const
private

Convert a win32 LPVARIANT to a string.

Parameters
aVaris the LPVARIANT to be converted.
aReturnStringis the string to store the variant within.

Definition at line 474 of file windows/sysinfo.cpp.

Member Data Documentation

◆ m_pClassObject

IWbemClassObject* KIPLATFORM::SYSINFO::m_pClassObject = nullptr
private

Definition at line 83 of file sysinfo_windows.h.

◆ m_pEnumerator

IEnumWbemClassObject* KIPLATFORM::SYSINFO::m_pEnumerator = nullptr
private

Definition at line 82 of file sysinfo_windows.h.

Referenced by freeWmi().

◆ m_pLoc

IWbemLocator* KIPLATFORM::SYSINFO::m_pLoc = nullptr
private

Definition at line 80 of file sysinfo_windows.h.

Referenced by freeWmi(), and openWmi().

◆ m_pSvc

IWbemServices* KIPLATFORM::SYSINFO::m_pSvc = nullptr
private

Definition at line 81 of file sysinfo_windows.h.

Referenced by freeWmi(), and openWmi().


The documentation for this class was generated from the following files: