13 [__DynamicallyInvokable]
17 private unsafe
void* m_value;
25 [__DynamicallyInvokable]
26 public static int Size 28 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
30 [__DynamicallyInvokable]
37 [SecuritySafeCritical]
38 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
39 internal unsafe
bool IsNull()
41 return m_value ==
null;
46 [SecuritySafeCritical]
49 [__DynamicallyInvokable]
52 m_value = (
void*)value;
58 [SecuritySafeCritical]
61 [__DynamicallyInvokable]
64 m_value = (
void*)value;
81 long @
int = info.GetInt64(
"value");
82 if (
Size == 4 && (@
int >
int.MaxValue || @
int <
int.MinValue))
86 m_value = (
void*)@
int;
101 info.AddValue(
"value", (
long)m_value);
108 [SecuritySafeCritical]
109 [__DynamicallyInvokable]
110 public unsafe
override bool Equals(
object obj)
114 return m_value == ((
IntPtr)obj).m_value;
121 [SecuritySafeCritical]
122 [__DynamicallyInvokable]
131 [SecuritySafeCritical]
132 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
134 [__DynamicallyInvokable]
137 long num = (long)m_value;
138 return checked((
int)num);
143 [SecuritySafeCritical]
144 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
146 [__DynamicallyInvokable]
149 return (
long)m_value;
154 [SecuritySafeCritical]
155 [__DynamicallyInvokable]
164 [SecuritySafeCritical]
165 [__DynamicallyInvokable]
174 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
176 public static explicit operator IntPtr(
int value)
185 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
187 public static explicit operator IntPtr(
long value)
196 [CLSCompliant(
false)]
197 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
199 public unsafe
static explicit operator IntPtr(
void* value)
207 [SecuritySafeCritical]
208 [CLSCompliant(
false)]
210 public unsafe
static explicit operator void*(
IntPtr value)
212 return value.m_value;
219 [SecuritySafeCritical]
221 public unsafe
static explicit operator int(
IntPtr value)
223 long num = (long)value.m_value;
224 return checked((
int)num);
230 [SecuritySafeCritical]
232 public unsafe
static explicit operator long(
IntPtr value)
234 return (
long)value.m_value;
242 [SecuritySafeCritical]
243 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
245 [__DynamicallyInvokable]
248 return value1.m_value == value2.m_value;
256 [SecuritySafeCritical]
257 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
259 [__DynamicallyInvokable]
262 return value1.m_value != value2.m_value;
269 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
273 return pointer + offset;
280 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
291 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
295 return pointer - offset;
302 [ReliabilityContract(
Consistency.MayCorruptInstance,
Cer.MayFail)]
311 [SecuritySafeCritical]
312 [CLSCompliant(
false)]
313 [ReliabilityContract(
Consistency.WillNotCorruptState,
Cer.Success)]
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
unsafe IntPtr(long value)
Initializes a new instance of T:System.IntPtr using the specified 64-bit pointer.
unsafe string ToString(string format)
Converts the numeric value of the current T:System.IntPtr object to its equivalent string representat...
unsafe IntPtr(int value)
Initializes a new instance of T:System.IntPtr using the specified 32-bit pointer or handle.
unsafe IntPtr(void *value)
Initializes a new instance of T:System.IntPtr using the specified pointer to an unspecified type.
unsafe long ToInt64()
Converts the value of this instance to a 64-bit signed integer.
static IntPtr operator+(IntPtr pointer, int offset)
Adds an offset to the value of a pointer.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Cer
Specifies a method's behavior when called within a constrained execution region.
unsafe void * ToPointer()
Converts the value of this instance to a pointer to an unspecified type.
Provides information about, and means to manipulate, the current environment and platform....
static unsafe bool operator==(IntPtr value1, IntPtr value2)
Determines whether two specified instances of T:System.IntPtr are equal.
static IntPtr Subtract(IntPtr pointer, int offset)
Subtracts an offset from the value of a pointer.
A platform-specific type that is used to represent a pointer or a handle.
unsafe override string ToString()
Converts the numeric value of the current T:System.IntPtr object to its equivalent string representat...
unsafe int ToInt32()
Converts the value of this instance to a 32-bit signed integer.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown when one of the arguments provided to a method is not valid.
static int Size
Gets the size of this instance.
static IntPtr Add(IntPtr pointer, int offset)
Adds an offset to the value of a pointer.
Allows an object to control its own serialization and deserialization.
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
Specifies that the class can be serialized.
unsafe override bool Equals(object obj)
Returns a value indicating whether this instance is equal to a specified object.
Consistency
Specifies a reliability contract.
static IntPtr operator -(IntPtr pointer, int offset)
Subtracts an offset from the value of a pointer.
Provides information about a specific culture (called a locale for unmanaged code development)....
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the ta...
static unsafe bool operator !=(IntPtr value1, IntPtr value2)
Determines whether two specified instances of T:System.IntPtr are not equal.
unsafe override int GetHashCode()
Returns the hash code for this instance.