mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-19 04:27:51 -05:00
Initialize WMI only once, remove init calls from everywhere it is called and initialize it once as a static variable
* See comment: https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/1581#note_684260496
This commit is contained in:
@@ -16,7 +16,6 @@ static void DetectAsusTUFLaptopWMIControllers(std::vector<RGBController*>&)
|
||||
// For now, checking for "TUF Gaming" should suffice
|
||||
|
||||
Wmi wmi;
|
||||
wmi.init();
|
||||
|
||||
std::vector<QueryObj> systemProduct;
|
||||
if (wmi.query("SELECT * FROM Win32_ComputerSystemProduct", systemProduct))
|
||||
|
||||
1
dependencies/dmiinfo.cpp
vendored
1
dependencies/dmiinfo.cpp
vendored
@@ -27,7 +27,6 @@ DMIInfo::DMIInfo()
|
||||
manufacturer = "";
|
||||
HRESULT hres;
|
||||
Wmi wmi;
|
||||
wmi.init();
|
||||
|
||||
// Query WMI for Win32_PnPSignedDriver entries with names matching "SMBUS" or "SM BUS"
|
||||
// These devices may be browsed under Device Manager -> System Devices
|
||||
|
||||
@@ -498,7 +498,6 @@ void i2c_smbus_i801_detect()
|
||||
i2c_smbus_interface * bus;
|
||||
HRESULT hres;
|
||||
Wmi wmi;
|
||||
wmi.init();
|
||||
|
||||
// Query WMI for Win32_PnPSignedDriver entries with names matching "SMBUS" or "SM BUS"
|
||||
// These devices may be browsed under Device Manager -> System Devices
|
||||
|
||||
@@ -192,7 +192,6 @@ void i2c_smbus_piix4_detect()
|
||||
i2c_smbus_interface * bus;
|
||||
HRESULT hres;
|
||||
Wmi wmi;
|
||||
wmi.init();
|
||||
|
||||
// Query WMI for Win32_PnPSignedDriver entries with names matching "SMBUS" or "SM BUS"
|
||||
// These devices may be browsed under Device Manager -> System Devices
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
IWbemLocator* Wmi::pLoc = nullptr;
|
||||
IWbemServices* Wmi::pSvc = nullptr;
|
||||
HRESULT WmiInit = Wmi::init();
|
||||
|
||||
// Taken from https://stackoverflow.com/questions/215963/
|
||||
// Convert a wide Unicode string to an UTF8 string
|
||||
|
||||
Reference in New Issue
Block a user