diff --git a/Hardware/ThreadAffinity.cs b/Hardware/ThreadAffinity.cs index 014f8dd..a4b8560 100755 --- a/Hardware/ThreadAffinity.cs +++ b/Hardware/ThreadAffinity.cs @@ -4,7 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - Copyright (C) 2010 Michael Möller + Copyright (C) 2010-2014 Michael Möller */ @@ -29,9 +29,15 @@ namespace OpenHardwareMonitor.Hardware { ref mask) != 0) return 0; return result; - } else { // Windows - return (ulong)NativeMethods.SetThreadAffinityMask( - NativeMethods.GetCurrentThread(), (UIntPtr)mask); + } else { // Windows + UIntPtr uIntPtrMask; + try { + uIntPtrMask = (UIntPtr)mask; + } catch (OverflowException) { + throw new ArgumentOutOfRangeException("mask"); + } + return (ulong)NativeMethods.SetThreadAffinityMask( + NativeMethods.GetCurrentThread(), uIntPtrMask); } } diff --git a/Properties/AssemblyVersion.cs b/Properties/AssemblyVersion.cs index 30f67a7..bd71a49 100644 --- a/Properties/AssemblyVersion.cs +++ b/Properties/AssemblyVersion.cs @@ -10,5 +10,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.7.0.0")] -[assembly: AssemblyInformationalVersion("0.7.0 Beta")] \ No newline at end of file +[assembly: AssemblyVersion("0.7.1.0")] +[assembly: AssemblyInformationalVersion("0.7.1 Beta")] \ No newline at end of file