KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sysinfo_windows.h
Go to the documentation of this file.
1/*
2* This program source code file is part of KiCad, a free EDA CAD application.
3*
4* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5*
6* This program is free software; you can redistribute it and/or
7* modify it under the terms of the GNU General Public License
8* as published by the Free Software Foundation; either version 2
9* of the License, or (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19
20#ifndef SYSINFO_WINDOWS_H
21#define SYSINFO_WINDOWS_H
22
23struct IWbemLocator;
24struct IWbemServices;
25struct IEnumWbemClassObject;
26struct IWbemClassObject;
27
28namespace KIPLATFORM
29{
30 class SYSINFO : SYSINFO_BASE
31 {
32 public:
35
36 bool GetCPUInfo( std::vector<CPU_INFO>& aCpuInfos ) override;
37 bool GetGPUInfo( std::vector<GPU_INFO>& aGpuInfos ) override;
38 bool GetMemoryInfo( MEMORY_INFO& aRamInfo ) override;
39
40 private:
41 HRESULT openWmi();
42 HRESULT freeWmi();
43
50 bool gpuFromDirectX( std::vector<GPU_INFO>& aGpuInfos );
51
60 bool getVersionFromDXRegistry( int64_t aAdapterLuid, std::string& aDriverVersion );
61
70 std::string improveDriverVersion( const std::string& aManufacturer, const std::string& aVersion );
71
80 void variantToString( const LPVARIANT aVar, std::string& aReturnString ) const;
81
82 IWbemLocator* m_pLoc = nullptr;
83 IWbemServices* m_pSvc = nullptr;
84 IEnumWbemClassObject* m_pEnumerator = nullptr;
85 IWbemClassObject* m_pClassObject = nullptr;
86 };
87}
88
89#endif // SYSINFO_WINDOWS_H
IWbemLocator * m_pLoc
void variantToString(const LPVARIANT aVar, std::string &aReturnString) const
Converts a win32 LPVARIANT to a string.
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.
bool gpuFromDirectX(std::vector< GPU_INFO > &aGpuInfos)
Fetches gpu info from directx and registry WMI unforunately has a uint32 max value issue for reportin...
IWbemClassObject * m_pClassObject
bool GetCPUInfo(std::vector< CPU_INFO > &aCpuInfos) override
Retrieve CPU info for the system.
IWbemServices * m_pSvc
bool GetGPUInfo(std::vector< GPU_INFO > &aGpuInfos) override
Retrieve GPU info for the system.
bool getVersionFromDXRegistry(int64_t aAdapterLuid, std::string &aDriverVersion)
Extracts the driver version for an dapter from the directx section of the registry.
IEnumWbemClassObject * m_pEnumerator
bool GetMemoryInfo(MEMORY_INFO &aRamInfo) override
Retrieve memory info for the system.