From 0d3ab7174cae58e33b9d2e76681b9f52f44c8f46 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Mon, 21 Oct 2013 19:41:26 +0200 Subject: [PATCH] Fixed crash on 32-bit machines uint-to-intptr conversion must obey uint-to-int conversions on 32-bit machines, otherwise an OverflowException may occur: conversions of numbers over 2^31-1 must be declared as unchecked. Fixes issue reported here: http://www.opentk.com/node/3418 --- Source/OpenTK/Platform/Windows/API.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index a31a8c84..21863680 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -1631,7 +1631,7 @@ namespace OpenTK.Platform.Windows internal static readonly IntPtr MESSAGE_ONLY = new IntPtr(-3); - internal static readonly IntPtr HKEY_LOCAL_MACHINE = new IntPtr(0x80000002); + internal static readonly IntPtr HKEY_LOCAL_MACHINE = new IntPtr(unchecked((int)0x80000002)); } #endregion