[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
A platform-specific type that is used to represent a pointer or a handle.
Assembly: mscorlib (in mscorlib.dll)
Thetype exposes the following members.
|UIntPtr(UInt32)||Initializes a new instance of the structure using the specified 32-bit pointer or handle.|
|UIntPtr(UInt64)||Initializes a new instance of using the specified 64-bit pointer or handle.|
|UIntPtr(Void*)||Security Critical. Initializes a new instance of using the specified pointer to an unspecified type.|
|Add||Adds an offset to the value of an unsigned pointer.|
|Equals||Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueType.Equals(Object).)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Returns the hash code for this instance. (Overrides ValueType.GetHashCode().)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|Subtract||Subtracts an offset from the value of an unsigned pointer.|
|ToPointer||Converts the value of this instance to a pointer to an unspecified type.|
|ToString||Converts the numeric value of this instance to its equivalent string representation. (Overrides ValueType.ToString().)|
|ToUInt32||Converts the value of this instance to a 32-bit unsigned integer.|
|ToUInt64||Converts the value of this instance to a 64-bit unsigned integer.|
|Addition||Adds an offset to the value of an unsigned pointer.|
|Equality||Determines whether two specified instances of are equal.|
|Explicit(UInt32 to UIntPtr)||Converts the value of a 32-bit unsigned integer to an .|
|Explicit(UInt64 to UIntPtr)||Converts the value of a 64-bit unsigned integer to an .|
|Explicit(UIntPtr to UInt64)||Converts the value of the specified to a 64-bit unsigned integer.|
|Explicit(UIntPtr to Void*)||Security Critical. Converts the value of the specified to a pointer to an unspecified type.|
|Explicit(UIntPtr to UInt32)||Converts the value of the specified to a 32-bit unsigned integer.|
|Explicit(Void* to UIntPtr)||Security Critical. Converts the specified pointer to an unspecified type to a .|
|Inequality||Determines whether two specified instances of are not equal.|
|Subtraction||Subtracts an offset from the value of an unsigned pointer.|
The type is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.
The IntPtr type is CLS-compliant, while the type is not. Only the IntPtr type is used in the common language runtime. The type is provided mostly to maintain architectural symmetry with the IntPtr type.
The type can be used by languages that support pointers, and as a common means of referring to data between languages that do and do not support pointers. objects can also be used to hold handles.