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
This commit is contained in:
Stefanos A. 2013-10-21 19:41:26 +02:00
parent 4dfcf39d26
commit 0d3ab7174c

View file

@ -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