/// <summary> /// Razer-SDK: Query for device information. /// </summary> internal static RazerError QueryDevice(Guid deviceId, out _DeviceInfo deviceInfo) { int structSize = Marshal.SizeOf(typeof(_DeviceInfo)); IntPtr deviceInfoPtr = Marshal.AllocHGlobal(structSize); RazerError error = _queryDevicePointer(deviceId, deviceInfoPtr); deviceInfo = (_DeviceInfo)Marshal.PtrToStructure(deviceInfoPtr, typeof(_DeviceInfo)); Marshal.FreeHGlobal(deviceInfoPtr); return(error); }
private void ThrowRazerError(RazerError errorCode) => throw new RazerException(errorCode);
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerException" /> class. /// </summary> /// <param name="errorCode">The error code provided by the SDK.</param> public RazerException(RazerError errorCode) { this.ErrorCode = errorCode; }