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 (C) 2020 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, you may find one here:
18* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19* or you may search the http://www.gnu.org website for the version 2 license,
20* or you may write to the Free Software Foundation, Inc.,
21* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22*/
23
24#ifndef SYSINFO_WINDOWS_H
25#define SYSINFO_WINDOWS_H
26
27struct IWbemLocator;
28struct IWbemServices;
29struct IEnumWbemClassObject;
30struct IWbemClassObject;
31
32namespace KIPLATFORM
33{
34 class SYSINFO : SYSINFO_BASE
35 {
36 public:
39
40 bool GetCPUInfo( std::vector<CPU_INFO>& aCpuInfos ) override;
41 bool GetGPUInfo( std::vector<GPU_INFO>& aGpuInfos ) override;
42 bool GetMemoryInfo( MEMORY_INFO& aRamInfo ) override;
43
44 private:
45 HRESULT openWmi();
46 HRESULT freeWmi();
47
54 bool gpuFromDirectX( std::vector<GPU_INFO>& aGpuInfos );
55
64 bool getVersionFromDXRegistry( int64_t aAdapterLuid, std::string& aDriverVersion );
65
74 std::string improveDriverVersion( const std::string& aManufacturer, const std::string& aVersion );
75
84 void variantToString( const LPVARIANT aVar, std::string& aReturnString ) const;
85
86 IWbemLocator* m_pLoc = nullptr;
87 IWbemServices* m_pSvc = nullptr;
88 IEnumWbemClassObject* m_pEnumerator = nullptr;
89 IWbemClassObject* m_pClassObject = nullptr;
90 };
91}
92
93#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.
Definition: app.h:28