This topic has not yet been rated - Rate this topic

UIntPtr Structure

A platform-specific type that is used to represent a pointer or a handle.

This API is not CLS-compliant. 

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
[SerializableAttribute]
[ComVisibleAttribute(true)]
[CLSCompliantAttribute(false)]
public struct UIntPtr : ISerializable

The UIntPtr type exposes the following members.

  Name Description
Public method Supported by the XNA Framework Supported by Portable Class Library UIntPtr(UInt32) Initializes a new instance of the UIntPtr structure using the specified 32-bit pointer or handle.
Public method Supported by the XNA Framework Supported by Portable Class Library UIntPtr(UInt64) Initializes a new instance of UIntPtr using the specified 64-bit pointer or handle.
Public method Supported by the XNA Framework UIntPtr(Void*) Initializes a new instance of UIntPtr using the specified pointer to an unspecified type.
Top
  Name Description
Public property Static member Supported by the XNA Framework Supported by Portable Class Library Size Gets the size of this instance.
Top
  Name Description
Public method Static member Add Adds an offset to the value of an unsigned pointer.
Public method Supported by the XNA Framework Supported by Portable Class Library Equals Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Protected method Supported by the XNA Framework Supported by Portable Class Library Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by the XNA Framework Supported by Portable Class Library GetHashCode Returns the hash code for this instance. (Overrides ValueType.GetHashCode().)
Public method Supported by the XNA Framework Supported by Portable Class Library GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Supported by the XNA Framework Supported by Portable Class Library MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Static member Subtract Subtracts an offset from the value of an unsigned pointer.
Public method Supported by the XNA Framework ToPointer Converts the value of this instance to a pointer to an unspecified type.
Public method Supported by the XNA Framework Supported by Portable Class Library ToString Converts the numeric value of this instance to its equivalent string representation. (Overrides ValueType.ToString().)
Public method Supported by the XNA Framework Supported by Portable Class Library ToUInt32 Converts the value of this instance to a 32-bit unsigned integer.
Public method Supported by the XNA Framework Supported by Portable Class Library ToUInt64 Converts the value of this instance to a 64-bit unsigned integer.
Top
  Name Description
Public operator Static member Addition Adds an offset to the value of an unsigned pointer.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Equality Determines whether two specified instances of UIntPtr are equal.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Explicit(UInt32 to UIntPtr) Converts the value of a 32-bit unsigned integer to an UIntPtr.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Explicit(UInt64 to UIntPtr) Converts the value of a 64-bit unsigned integer to an UIntPtr.
Public operator Static member Supported by the XNA Framework Explicit(UIntPtr to Void*) Converts the value of the specified UIntPtr to a pointer to an unspecified type.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Explicit(UIntPtr to UInt32) Converts the value of the specified UIntPtr to a 32-bit unsigned integer.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Explicit(UIntPtr to UInt64) Converts the value of the specified UIntPtr to a 64-bit unsigned integer.
Public operator Static member Supported by the XNA Framework Explicit(Void* to UIntPtr) Converts the specified pointer to an unspecified type to a UIntPtr.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Inequality Determines whether two specified instances of UIntPtr are not equal.
Public operator Static member Subtraction Subtracts an offset from the value of an unsigned pointer.
Top
  Name Description
Public field Static member Supported by the XNA Framework Supported by Portable Class Library Zero A read-only field that represents a pointer or handle that has been initialized to zero.
Top
  Name Description
Explicit interface implemetation Private method ISerializable.GetObjectData Populates a SerializationInfo object with the data needed to serialize the current UIntPtr object.
Top

The UIntPtr 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.

Important note Important

   The IntPtr type is CLS-compliant, while the UIntPtr type is not. Only the IntPtr type is used in the common language runtime. The UIntPtr type is provided mostly to maintain architectural symmetry with the IntPtr type.

The UIntPtr 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. UIntPtr objects can also be used to hold handles.

This type implements the ISerializable interface.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

This type is thread safe.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ