From 83a3ea4e01613e2f5bab9f68212be2401fcbf3e2 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 26 Nov 2017 08:34:36 +0100 Subject: [PATCH] Added a workaround for the AccessViolation-problem in the aura-sdk --- RGB.NET.Devices.Asus/AsusDeviceProvider.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs index 7fa246b..b764395 100644 --- a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs +++ b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs @@ -95,7 +95,9 @@ namespace RGB.NET.Devices.Asus try { - int mainboardCount = _AsusSDK.EnumerateMbController(IntPtr.Zero, 0); + //TODO DarthAffe 26.11.2017: This is not a fix! There might really be a second controller on the mainboard, but for now this should prevent the random crash for some guys. + // DarthAffe 26.11.2017: https://rog.asus.com/forum/showthread.php?97754-Access-Violation-Wrong-EnumerateMB-Result&p=688901#post688901 + int mainboardCount = Math.Max(1, _AsusSDK.EnumerateMbController(IntPtr.Zero, 0)); if (mainboardCount > 0) { IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size);