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

#include <sysinfo_gtk.h>

Inheritance diagram for KIPLATFORM::SYSINFO:
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 &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 &aRamInfo) override
 Retrieve memory info for the system.
 

Private Member Functions

HRESULT openWmi ()
 
HRESULT freeWmi ()
 
bool gpuFromDirectX (std::vector< GPU_INFO > &aGpuInfos)
 Fetches gpu info from directx and registry WMI unforunately has a uint32 max value issue for reporting gpu memory, meanwhile directx does not have this issue.
 
bool getVersionFromDXRegistry (int64_t aAdapterLuid, std::string &aDriverVersion)
 Extracts the driver version for an dapter from the directx section of the registry.
 
std::string improveDriverVersion (const std::string &aManufacturer, const std::string &aVersion)
 Attempts to convert the Windows driver version string to the vendor version string if possible.
 
void variantToString (const LPVARIANT aVar, std::string &aReturnString) const
 Converts 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 29 of file sysinfo_gtk.h.

Constructor & Destructor Documentation

◆ SYSINFO() [1/3]

KIPLATFORM::SYSINFO::SYSINFO ( )

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

◆ ~SYSINFO() [1/3]

KIPLATFORM::SYSINFO::~SYSINFO ( )

Definition at line 31 of file gtk/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 165 of file msw/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 40 of file gtk/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 45 of file gtk/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.

Definition at line 35 of file gtk/sysinfo.cpp.

◆ 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.

◆ getVersionFromDXRegistry()

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

Extracts the driver version for an dapter 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 315 of file msw/sysinfo.cpp.

Referenced by gpuFromDirectX().

◆ gpuFromDirectX()

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

Fetches gpu info from directx and registry WMI unforunately 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 391 of file msw/sysinfo.cpp.

References KIPLATFORM::GPU_INFO::DriverVersion, getVersionFromDXRegistry(), improveDriverVersion(), 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

Attempts 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 188 of file msw/sysinfo.cpp.

Referenced by gpuFromDirectX().

◆ openWmi()

HRESULT KIPLATFORM::SYSINFO::openWmi ( )
private

Definition at line 109 of file msw/sysinfo.cpp.

References m_pLoc, and m_pSvc.

◆ variantToString()

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

Converts a win32 LPVARIANT to a string.

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

Definition at line 478 of file msw/sysinfo.cpp.

Member Data Documentation

◆ m_pClassObject

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

Definition at line 89 of file sysinfo_windows.h.

◆ m_pEnumerator

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

Definition at line 88 of file sysinfo_windows.h.

Referenced by freeWmi().

◆ m_pLoc

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

Definition at line 86 of file sysinfo_windows.h.

Referenced by freeWmi(), and openWmi().

◆ m_pSvc

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

Definition at line 87 of file sysinfo_windows.h.

Referenced by freeWmi(), and openWmi().


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