1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00

Added workaround for corsair custom devices with wrongly reported channel counts

This commit is contained in:
Darth Affe 2021-07-02 22:23:35 +02:00
parent 95eeef2d04
commit eedeadabda
2 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ namespace RGB.NET.Devices.Corsair
int channelDeviceInfoStructSize = Marshal.SizeOf(typeof(_CorsairChannelDeviceInfo)); int channelDeviceInfoStructSize = Marshal.SizeOf(typeof(_CorsairChannelDeviceInfo));
IntPtr channelDeviceInfoPtr = channelInfo.devices; IntPtr channelDeviceInfoPtr = channelInfo.devices;
for (int device = 0; device < channelInfo.devicesCount; device++) for (int device = 0; (device < channelInfo.devicesCount) && (ledOffset < nativeDeviceInfo.ledsCount); device++)
{ {
_CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo))!; _CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo))!;

View File

@ -81,7 +81,7 @@ namespace RGB.NET.Devices.Corsair
switch (channelDeviceInfo.type) switch (channelDeviceInfo.type)
{ {
case CorsairChannelDeviceType.Invalid: case CorsairChannelDeviceType.Invalid:
return "Invalid"; return model;
case CorsairChannelDeviceType.FanHD: case CorsairChannelDeviceType.FanHD:
return "HD Fan"; return "HD Fan";