mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-07 07:34:25 -04:00
Fix coolermaster rescan crash
This commit is contained in:
@@ -10,24 +10,22 @@
|
||||
|
||||
CMKeyboardAbstractController::CMKeyboardAbstractController(hid_device* dev_handle, hid_device_info* dev_info)
|
||||
{
|
||||
const uint8_t sz = HID_MAX_STR;
|
||||
wchar_t tmp[sz];
|
||||
wchar_t tmp[HID_MAX_STR];
|
||||
|
||||
m_pDev = dev_handle;
|
||||
m_productId = dev_info->product_id;
|
||||
m_sLocation = dev_info->path;
|
||||
m_pDev = dev_handle;
|
||||
m_productId = dev_info->product_id;
|
||||
m_sLocation = dev_info->path;
|
||||
|
||||
hid_get_manufacturer_string(m_pDev, tmp, sz);
|
||||
std::wstring wName = std::wstring(tmp);
|
||||
m_vendorName = std::string(wName.begin(), wName.end());
|
||||
hid_get_manufacturer_string(m_pDev, tmp, HID_MAX_STR);
|
||||
std::wstring wVendorName = std::wstring(tmp);
|
||||
m_vendorName = std::string(wVendorName.begin(), wVendorName.end());
|
||||
|
||||
hid_get_product_string(m_pDev, tmp, sz);
|
||||
wName = std::wstring(tmp);
|
||||
m_deviceName = std::string(wName.begin(), wName.end());
|
||||
hid_get_product_string(m_pDev, tmp, HID_MAX_STR);
|
||||
std::wstring wDeviceName = std::wstring(tmp);
|
||||
m_deviceName = std::string(wDeviceName.begin(), wDeviceName.end());
|
||||
m_serialNumber = m_deviceName;
|
||||
|
||||
m_serialNumber = m_deviceName;
|
||||
|
||||
bool bNotFound = true;
|
||||
bool bNotFound = true;
|
||||
|
||||
for(uint16_t i = 0; i < COOLERMASTER_KEYBOARD_DEVICE_COUNT; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user