MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / DMIInfo

Method DMIInfo

dependencies/dmiinfo.cpp:25–48  ·  view source on GitHub ↗

\ * * * DMIInfo (Windows) * * * * Implementing way to read motherboard vendor and name based on * * the win32_baseboar

Source from the content-addressed store, hash-verified

23* *
24\******************************************************************************************/
25DMIInfo::DMIInfo()
26{
27 mainboard = "";
28 manufacturer = "";
29 HRESULT hres;
30 Wmi wmi;
31
32 // Query WMI for Win32_PnPSignedDriver entries with names matching "SMBUS" or "SM BUS"
33 // These devices may be browsed under Device Manager -> System Devices
34 std::vector<QueryObj> q_res_BaseBoard;
35 hres = wmi.query("SELECT * FROM Win32_BaseBoard", q_res_BaseBoard);
36
37 if (hres)
38 {
39 LOG_DEBUG("[DMI Info] Unable to read from %s", WMI);
40 return;
41 }
42
43 for (QueryObj &i : q_res_BaseBoard)
44 {
45 manufacturer = i["Manufacturer"].c_str();
46 mainboard = i["Product"].c_str();
47 }
48}
49#else /* WIN32 */
50
51

Callers

nothing calls this directly

Calls 1

queryMethod · 0.80

Tested by

no test coverage detected