Skip to content

Commit

Permalink
Merge pull request #99 from CoraleStudios/hotfix/ignore-priority-errors
Browse files Browse the repository at this point in the history
Ignore RzAccessDenied errors from SetEffect
  • Loading branch information
brandonscott committed Oct 27, 2015
2 parents 5587348 + bd77930 commit 379e40b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Corale.Colore/Core/NativeWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ namespace Corale.Colore.Core

using Corale.Colore.Razer;
using Corale.Colore.Razer.Keyboard.Effects;

using log4net;

/// <summary>
/// Helper class to more easily make calls to native Chroma SDK functions.
/// </summary>
internal static class NativeWrapper
{
/// <summary>
/// Logger instance for this class.
/// </summary>
private static readonly ILog Log = LogManager.GetLogger(typeof(NativeWrapper));

/// <summary>
/// Creates an effect for a device.
/// </summary>
Expand Down Expand Up @@ -461,7 +468,12 @@ internal static void RegisterEventNotification(IntPtr hwnd)
internal static void SetEffect(Guid guid)
{
var result = NativeMethods.SetEffect(guid);
if (!result)
if (result)
return;

if (result == Result.RzAccessDenied)
Log.Warn("Ambigous RzAccessDenied error thrown from call to native function SetEffect.");
else
throw new NativeCallException("SetEffect", result);
}

Expand Down

0 comments on commit 379e40b

Please sign in to comment.