Export (0) Print
Expand All

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)

[<Sealed>]
[<SerializableAttribute>]
[<ComVisibleAttribute(true)>]
[<CLSCompliantAttribute(false)>]
type UIntPtr =  
    struct 
        interface ISerializable 
    end

The UIntPtr type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsUIntPtr(UInt32)Initializes a new instance of the UIntPtr structure using the specified 32-bit pointer or handle.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsUIntPtr(UInt64)Initializes a new instance of UIntPtr using the specified 64-bit pointer or handle.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsUIntPtr(Void*)Initializes a new instance of UIntPtr using the specified pointer to an unspecified type.
Top

  NameDescription
Public propertyStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsSizeGets the size of this instance.
Top

  NameDescription
Public methodStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsAddAdds an offset to the value of an unsigned pointer.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsEqualsReturns a value indicating whether this instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetHashCodeReturns the hash code for this instance. (Overrides ValueType.GetHashCode().)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsSubtractSubtracts an offset from the value of an unsigned pointer.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsToPointerConverts the value of this instance to a pointer to an unspecified type.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsToStringConverts the numeric value of this instance to its equivalent string representation. (Overrides ValueType.ToString().)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsToUInt32Converts the value of this instance to a 32-bit unsigned integer.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsToUInt64Converts the value of this instance to a 64-bit unsigned integer.
Top

  NameDescription
Public operatorStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsAdditionAdds an offset to the value of an unsigned pointer.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsEqualityDetermines whether two specified instances of UIntPtr are equal.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsExplicit(UInt32 to UIntPtr)Converts the value of a 32-bit unsigned integer to an UIntPtr.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsExplicit(UInt64 to UIntPtr)Converts the value of a 64-bit unsigned integer to an UIntPtr.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsExplicit(UIntPtr to Void*)Converts the value of the specified UIntPtr to a pointer to an unspecified type.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsExplicit(UIntPtr to UInt64)Converts the value of the specified UIntPtr to a 64-bit unsigned integer.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsExplicit(UIntPtr to UInt32)Converts the value of the specified UIntPtr to a 32-bit unsigned integer.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsExplicit(Void* to UIntPtr)Converts the specified pointer to an unspecified type to a UIntPtr.
Public operatorStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsInequalityDetermines whether two specified instances of UIntPtr are not equal.
Public operatorStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsSubtractionSubtracts an offset from the value of an unsigned pointer.
Top

  NameDescription
Public fieldStatic memberSupported by the XNA FrameworkSupported by Portable Class LibrarySupported in .NET for Windows Store appsZeroA read-only field that represents a pointer or handle that has been initialized to zero.
Top

  NameDescription
Explicit interface implemetationPrivate methodISerializable.GetObjectDataPopulates 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 noteImportant

   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.5.2, 4.5.1, 4.5, 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

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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.

Show:
© 2014 Microsoft