From a2a03008828647a91ce57f478bf2d437d9384ace Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Fri, 16 Oct 2015 17:42:33 +0200 Subject: [PATCH 1/2] Fixed wrong encodings for SDK-strings. This should resolve #24 --- Devices/Generic/CorsairProtocolDetails.cs | 4 ++-- Devices/Generic/GenericDeviceInfo.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Devices/Generic/CorsairProtocolDetails.cs b/Devices/Generic/CorsairProtocolDetails.cs index 2f53ea1..5db94d6 100644 --- a/Devices/Generic/CorsairProtocolDetails.cs +++ b/Devices/Generic/CorsairProtocolDetails.cs @@ -54,8 +54,8 @@ namespace CUE.NET.Devices.Generic /// The native CorsairProtocolDetails-struct internal CorsairProtocolDetails(_CorsairProtocolDetails nativeDetails) { - this.SdkVersion = nativeDetails.sdkVersion == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeDetails.sdkVersion); - this.ServerVersion = nativeDetails.serverVersion == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeDetails.serverVersion); + this.SdkVersion = nativeDetails.sdkVersion == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(nativeDetails.sdkVersion); + this.ServerVersion = nativeDetails.serverVersion == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(nativeDetails.serverVersion); this.SdkProtocolVersion = nativeDetails.sdkProtocolVersion; this.ServerProtocolVersion = nativeDetails.serverProtocolVersion; this.BreakingChanges = nativeDetails.breakingChanges != 0; diff --git a/Devices/Generic/GenericDeviceInfo.cs b/Devices/Generic/GenericDeviceInfo.cs index 0d70704..d72f917 100644 --- a/Devices/Generic/GenericDeviceInfo.cs +++ b/Devices/Generic/GenericDeviceInfo.cs @@ -35,7 +35,7 @@ namespace CUE.NET.Devices.Generic internal GenericDeviceInfo(_CorsairDeviceInfo nativeInfo) { this.Type = nativeInfo.type; - this.Model = nativeInfo.model == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeInfo.model); + this.Model = nativeInfo.model == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(nativeInfo.model); this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask; } From 0c862fc6de5361733d0a76a8a450d86b94408eb8 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 18 Oct 2015 17:17:38 +0200 Subject: [PATCH 2/2] Fixed build error in example-project --- Examples/SimpleDevTest/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/SimpleDevTest/Program.cs b/Examples/SimpleDevTest/Program.cs index 92444b3..119a98c 100644 --- a/Examples/SimpleDevTest/Program.cs +++ b/Examples/SimpleDevTest/Program.cs @@ -3,14 +3,14 @@ using System.Drawing; using System.Threading; using System.Threading.Tasks; using CUE.NET; +using CUE.NET.Brushes; using CUE.NET.Devices.Generic.Enums; using CUE.NET.Devices.Keyboard; -using CUE.NET.Devices.Keyboard.Brushes; -using CUE.NET.Devices.Keyboard.Brushes.Gradient; using CUE.NET.Devices.Keyboard.Enums; using CUE.NET.Devices.Keyboard.Extensions; using CUE.NET.Devices.Keyboard.Keys; using CUE.NET.Exceptions; +using CUE.NET.Gradients; namespace SimpleDevTest {