diff options
Diffstat (limited to 'src/mscorlib/src/System/IntPtr.cs')
-rw-r--r-- | src/mscorlib/src/System/IntPtr.cs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/mscorlib/src/System/IntPtr.cs b/src/mscorlib/src/System/IntPtr.cs index c7eea36447..2d66652ab8 100644 --- a/src/mscorlib/src/System/IntPtr.cs +++ b/src/mscorlib/src/System/IntPtr.cs @@ -26,13 +26,11 @@ namespace System { [System.Runtime.InteropServices.ComVisible(true)] public struct IntPtr : IEquatable<IntPtr>, ISerializable { - [SecurityCritical] unsafe private void* m_value; // The compiler treats void* closest to uint hence explicit casts are required to preserve int behavior public static readonly IntPtr Zero; // fast way to compare IntPtr to (IntPtr)0 while IntPtr.Zero doesn't work due to slow statics access - [System.Security.SecuritySafeCritical] // auto-generated [Pure] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] internal unsafe bool IsNull() @@ -40,7 +38,6 @@ namespace System { return (this.m_value == null); } - [System.Security.SecuritySafeCritical] // auto-generated [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] [System.Runtime.Versioning.NonVersionable] public unsafe IntPtr(int value) @@ -52,7 +49,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] [System.Runtime.Versioning.NonVersionable] public unsafe IntPtr(long value) @@ -64,7 +60,6 @@ namespace System { #endif } - [System.Security.SecurityCritical] [CLSCompliant(false)] [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] [System.Runtime.Versioning.NonVersionable] @@ -73,7 +68,6 @@ namespace System { m_value = value; } - [System.Security.SecurityCritical] // auto-generated private unsafe IntPtr(SerializationInfo info, StreamingContext context) { long l = info.GetInt64("value"); @@ -84,10 +78,9 @@ namespace System { m_value = (void *)l; } - [System.Security.SecurityCritical] unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); } Contract.EndContractBlock(); #if BIT64 @@ -97,7 +90,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated public unsafe override bool Equals(Object obj) { if (obj is IntPtr) { return (m_value == ((IntPtr)obj).m_value); @@ -105,27 +97,20 @@ namespace System { return false; } - [SecuritySafeCritical] unsafe bool IEquatable<IntPtr>.Equals(IntPtr other) { return m_value == other.m_value; } - [System.Security.SecuritySafeCritical] // auto-generated public unsafe override int GetHashCode() { -#if FEATURE_CORECLR #if BIT64 long l = (long)m_value; return (unchecked((int)l) ^ (int)(l >> 32)); #else // !BIT64 (32) return unchecked((int)m_value); #endif -#else - return unchecked((int)((long)m_value)); -#endif } - [System.Security.SecuritySafeCritical] // auto-generated [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [System.Runtime.Versioning.NonVersionable] public unsafe int ToInt32() { @@ -137,7 +122,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [System.Runtime.Versioning.NonVersionable] public unsafe long ToInt64() { @@ -148,7 +132,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated public unsafe override String ToString() { #if BIT64 return ((long)m_value).ToString(CultureInfo.InvariantCulture); @@ -157,7 +140,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated public unsafe String ToString(String format) { Contract.Ensures(Contract.Result<String>() != null); @@ -184,7 +166,6 @@ namespace System { return new IntPtr(value); } - [System.Security.SecurityCritical] [CLSCompliant(false), ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] [System.Runtime.Versioning.NonVersionable] public static unsafe explicit operator IntPtr (void* value) @@ -192,7 +173,6 @@ namespace System { return new IntPtr(value); } - [System.Security.SecuritySafeCritical] // auto-generated [CLSCompliant(false)] [System.Runtime.Versioning.NonVersionable] public static unsafe explicit operator void* (IntPtr value) @@ -200,7 +180,6 @@ namespace System { return value.m_value; } - [System.Security.SecuritySafeCritical] // auto-generated [System.Runtime.Versioning.NonVersionable] public unsafe static explicit operator int (IntPtr value) { @@ -212,7 +191,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated [System.Runtime.Versioning.NonVersionable] public unsafe static explicit operator long (IntPtr value) { @@ -223,7 +201,6 @@ namespace System { #endif } - [System.Security.SecuritySafeCritical] // auto-generated [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [System.Runtime.Versioning.NonVersionable] public unsafe static bool operator == (IntPtr value1, IntPtr value2) @@ -231,7 +208,6 @@ namespace System { return value1.m_value == value2.m_value; } - [System.Security.SecuritySafeCritical] // auto-generated [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [System.Runtime.Versioning.NonVersionable] public unsafe static bool operator != (IntPtr value1, IntPtr value2) @@ -289,7 +265,6 @@ namespace System { } - [System.Security.SecuritySafeCritical] // auto-generated [CLSCompliant(false)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [System.Runtime.Versioning.NonVersionable] |