You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GPU class in one of Win32 getVendor, getName, getDriverVersion, you try retrive 0 element from vector, and then you check if ret is string is empty, but if vector is empty and you try to retrive 0 element is crashed.
How it was:
std::string GPU::getVendor() {
std::vector<constwchar_t*> vendor{};
wmi::queryWMI("WIN32_VideoController", "AdapterCompatibility", vendor);
auto ret = vendor[0];
if (!ret) {
return"<unknown>";
}
std::wstring tmp(ret);
return {tmp.begin(), tmp.end()};
}
How it should be :
std::string GPU::getVendor() {
std::vector<constwchar_t*> vendor{};
wmi::queryWMI("WIN32_VideoController", "AdapterCompatibility", vendor);
if(vendor.empty())
return"<unknown>";
auto ret = vendor[0];
std::wstring tmp(ret);
return {tmp.begin(), tmp.end()};
}
Please fix this with all this functions, even if library cannot retrive some hardware properties it at least should return unknown but not a crash.
The text was updated successfully, but these errors were encountered:
Thanks) Also you have the same issue in Win32 Motherboard class.
And another bug I've found that when on Windows multiple times use CoInitialize and CoUninitialize, it crashes or not retriving the next info at all (first info fine), so l've try to initialize it once and when all information I need I get then uninitialize it. Maybe it problem with my project because somewhere I already call this.
For test I create init.h and init.cpp files with init(), close() functions, then move initialization/uninitialization code there, and between them retrieve relevant information.
In GPU class in one of Win32 getVendor, getName, getDriverVersion, you try retrive 0 element from vector, and then you check if ret is string is empty, but if vector is empty and you try to retrive 0 element is crashed.
How it was:
How it should be :
Please fix this with all this functions, even if library cannot retrive some hardware properties it at least should return unknown but not a crash.
The text was updated successfully, but these errors were encountered: