# HG changeset patch # User moel.mich # Date 1419979772 0 # Node ID 7b859a06eecb85dce1b23370f433dfff85e72c6b # Parent 0e46e3ca812a9bd447954b67efe3327edfbf1b71 Fixed an OverflowException when trying to use (unsupported) 64-bit thread affinity masks on 32-bit systems. diff -r 0e46e3ca812a -r 7b859a06eecb Hardware/ThreadAffinity.cs --- a/Hardware/ThreadAffinity.cs Tue Dec 30 22:47:39 2014 +0000 +++ b/Hardware/ThreadAffinity.cs Tue Dec 30 22:49:32 2014 +0000 @@ -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 @@ 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 -r 0e46e3ca812a -r 7b859a06eecb Properties/AssemblyVersion.cs --- a/Properties/AssemblyVersion.cs Tue Dec 30 22:47:39 2014 +0000 +++ b/Properties/AssemblyVersion.cs Tue Dec 30 22:49:32 2014 +0000 @@ -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