UIntPtr Struct

Definition

Important

This API is not CLS-compliant.

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

public value class UIntPtr
public value class UIntPtr : IComparable, IComparable<UIntPtr>, IEquatable<UIntPtr>, IFormattable, System::Runtime::Serialization::ISerializable
public value class UIntPtr : IEquatable<UIntPtr>, System::Runtime::Serialization::ISerializable
public value class UIntPtr : System::Runtime::Serialization::ISerializable
public struct UIntPtr
[System.CLSCompliant(false)]
public struct UIntPtr : IComparable, IComparable<UIntPtr>, IEquatable<UIntPtr>, IFormattable, System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
public struct UIntPtr
[System.CLSCompliant(false)]
public struct UIntPtr : IEquatable<UIntPtr>, System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
[System.Serializable]
public struct UIntPtr : System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct UIntPtr : System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
public struct UIntPtr : System.Runtime.Serialization.ISerializable
type unativeint = struct
[<System.CLSCompliant(false)>]
type unativeint = struct
    interface IFormattable
    interface ISerializable
[<System.CLSCompliant(false)>]
type unativeint = struct
[<System.CLSCompliant(false)>]
type unativeint = struct
    interface ISerializable
[<System.CLSCompliant(false)>]
[<System.Serializable>]
type unativeint = struct
    interface ISerializable
[<System.CLSCompliant(false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type unativeint = struct
    interface ISerializable
Public Structure UIntPtr
Public Structure UIntPtr
Implements IComparable, IComparable(Of UIntPtr), IEquatable(Of UIntPtr), IFormattable, ISerializable
Public Structure UIntPtr
Implements IEquatable(Of UIntPtr), ISerializable
Public Structure UIntPtr
Implements ISerializable
Inheritance
UIntPtr
Attributes
Implements

Remarks

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

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, and, in .NET 5.0 and later, the IFormattable interfaces.

Constructors

UIntPtr(UInt32)

Initializes a new instance of the UIntPtr structure using the specified 32-bit pointer or handle.

UIntPtr(UInt64)

Initializes a new instance of UIntPtr using the specified 64-bit pointer or handle.

UIntPtr(Void*)

Initializes a new instance of UIntPtr using the specified pointer to an unspecified type.

Fields

Zero

A read-only field that represents a pointer or handle that has been initialized to zero.

Properties

MaxValue

Represents the largest possible value of UIntPtr.

MinValue

Represents the smallest possible value of UIntPtr.

Size

Gets the size of this instance.

Methods

Add(UIntPtr, Int32)

Adds an offset to the value of an unsigned pointer.

CompareTo(Object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

CompareTo(UIntPtr)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Equals(Object)

Returns a value indicating whether this instance is equal to a specified object.

Equals(UIntPtr)

Indicates whether the current object is equal to another object of the same type.

GetHashCode()

Returns the hash code for this instance.

Parse(String)

Converts the string representation of a number to its unsigned native integer equivalent.

Parse(String, IFormatProvider)

Converts the string representation of a number in a specified culture-specific format to its unsigned native integer equivalent.

Parse(String, NumberStyles)

Converts the string representation of a number in a specified style to its unsigned native integer equivalent.

Parse(String, NumberStyles, IFormatProvider)

Converts the string representation of a number in a specified style and culture-specific format to its unsigned native integer equivalent.

Subtract(UIntPtr, Int32)

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.

ToString(IFormatProvider)

Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.

ToString(String)

Converts the numeric value of this instance to its equivalent string representation, using the specified format.

ToString(String, IFormatProvider)

Formats the value of the current instance using the specified format.

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.

TryParse(String, NumberStyles, IFormatProvider, UIntPtr)

Converts the string representation of a number in a specified style and culture-specific format to its unsigned native integer equivalent. A return value indicates whether the conversion succeeded.

TryParse(String, UIntPtr)

Converts the string representation of a number to its unsigned native integer equivalent. A return value indicates whether the conversion succeeded.

Operators

Addition(UIntPtr, Int32)

Adds an offset to the value of an unsigned pointer.

Equality(UIntPtr, UIntPtr)

Determines whether two specified instances of UIntPtr are equal.

Explicit(UInt32 to UIntPtr)

Converts the value of a 32-bit unsigned integer to an UIntPtr.

Explicit(UInt64 to UIntPtr)

Converts the value of a 64-bit unsigned integer to an UIntPtr.

Explicit(UIntPtr to UInt32)

Converts the value of the specified UIntPtr to a 32-bit unsigned integer.

Explicit(UIntPtr to UInt64)

Converts the value of the specified UIntPtr to a 64-bit unsigned integer.

Explicit(UIntPtr to Void*)

Converts the value of the specified UIntPtr to a pointer to an unspecified type.

This API is not CLS-compliant.

Explicit(Void* to UIntPtr)

Converts the specified pointer to an unspecified type to an UIntPtr.

This API is not CLS-compliant.

Inequality(UIntPtr, UIntPtr)

Determines whether two specified instances of UIntPtr are not equal.

Subtraction(UIntPtr, Int32)

Subtracts an offset from the value of an unsigned pointer.

Explicit Interface Implementations

IEquatable<UIntPtr>.Equals(UIntPtr)

Returns a value that indicates whether this instance is equal to another unsigned integer pointer.

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo object with the data needed to serialize the current UIntPtr object.

Applies to

Thread Safety

This type is thread safe.

See also