mscorlib(4.0.0.0) API with additions
System.UIntPtr Struct Reference

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

Inheritance diagram for System.UIntPtr:
[legend]
Collaboration diagram for System.UIntPtr:
[legend]

Public Member Functions

unsafe UIntPtr (uint value)
 Initializes a new instance of the T:System.UIntPtr structure using the specified 32-bit pointer or handle. More...
 
unsafe UIntPtr (ulong value)
 Initializes a new instance of T:System.UIntPtr using the specified 64-bit pointer or handle. More...
 
unsafe UIntPtr (void *value)
 Initializes a new instance of T:System.UIntPtr using the specified pointer to an unspecified type. More...
 
unsafe void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 Populates a T:System.Runtime.Serialization.SerializationInfo object with the data needed to serialize the current T:System.UIntPtr object. More...
 
unsafe override bool Equals (object obj)
 Returns a value indicating whether this instance is equal to a specified object. More...
 
unsafe override int GetHashCode ()
 Returns the hash code for this instance. More...
 
unsafe uint ToUInt32 ()
 Converts the value of this instance to a 32-bit unsigned integer. More...
 
unsafe ulong ToUInt64 ()
 Converts the value of this instance to a 64-bit unsigned integer. More...
 
unsafe override string ToString ()
 Converts the numeric value of this instance to its equivalent string representation. More...
 
unsafe void * ToPointer ()
 Converts the value of this instance to a pointer to an unspecified type. More...
 

Static Public Member Functions

static operator UIntPtr (uint value)
 Converts the value of a 32-bit unsigned integer to an T:System.UIntPtr. More...
 
static operator UIntPtr (ulong value)
 Converts the value of a 64-bit unsigned integer to an T:System.UIntPtr. More...
 
static unsafe operator uint (UIntPtr value)
 Converts the value of the specified T:System.UIntPtr to a 32-bit unsigned integer. More...
 
static unsafe operator ulong (UIntPtr value)
 Converts the value of the specified T:System.UIntPtr to a 64-bit unsigned integer. More...
 
static unsafe operator UIntPtr (void *value)
 Converts the specified pointer to an unspecified type to a T:System.UIntPtr. More...
 
static unsafe operator void * (UIntPtr value)
 Converts the value of the specified T:System.UIntPtr to a pointer to an unspecified type. More...
 
static unsafe bool operator== (UIntPtr value1, UIntPtr value2)
 Determines whether two specified instances of T:System.UIntPtr are equal. More...
 
static unsafe bool operator != (UIntPtr value1, UIntPtr value2)
 Determines whether two specified instances of T:System.UIntPtr are not equal. More...
 
static UIntPtr Add (UIntPtr pointer, int offset)
 Adds an offset to the value of an unsigned pointer. More...
 
static UIntPtr operator+ (UIntPtr pointer, int offset)
 Adds an offset to the value of an unsigned pointer. More...
 
static UIntPtr Subtract (UIntPtr pointer, int offset)
 Subtracts an offset from the value of an unsigned pointer. More...
 
static UIntPtr operator - (UIntPtr pointer, int offset)
 Subtracts an offset from the value of an unsigned pointer. More...
 

Static Public Attributes

static readonly UIntPtr Zero
 A read-only field that represents a pointer or handle that has been initialized to zero. More...
 

Properties

static int Size [get]
 Gets the size of this instance. More...
 

Detailed Description

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

Definition at line 14 of file UIntPtr.cs.

Constructor & Destructor Documentation

◆ UIntPtr() [1/3]

unsafe System.UIntPtr.UIntPtr ( uint  value)

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

Parameters
valueA pointer or handle contained in a 32-bit unsigned integer.

Definition at line 40 of file UIntPtr.cs.

◆ UIntPtr() [2/3]

unsafe System.UIntPtr.UIntPtr ( ulong  value)

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

Parameters
valueA pointer or handle contained in a 64-bit unsigned integer.
Exceptions
T:System.OverflowExceptionOn a 32-bit platform, value is too large to represent as an T:System.UIntPtr.

Definition at line 51 of file UIntPtr.cs.

◆ UIntPtr() [3/3]

unsafe System.UIntPtr.UIntPtr ( void *  value)

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

Parameters
valueA pointer to an unspecified type.

Definition at line 61 of file UIntPtr.cs.

Member Function Documentation

◆ Add()

static UIntPtr System.UIntPtr.Add ( UIntPtr  pointer,
int  offset 
)
static

Adds an offset to the value of an unsigned pointer.

Parameters
pointerThe unsigned pointer to add the offset to.
offsetThe offset to add.
Returns
A new unsigned pointer that reflects the addition of offset to pointer .

Definition at line 239 of file UIntPtr.cs.

◆ Equals()

unsafe override bool System.UIntPtr.Equals ( object  obj)

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

Parameters
objAn object to compare with this instance or null.
Returns
true if obj is an instance of T:System.UIntPtr and equals the value of this instance; otherwise, false.

Definition at line 98 of file UIntPtr.cs.

◆ GetHashCode()

unsafe override int System.UIntPtr.GetHashCode ( )

Returns the hash code for this instance.

Returns
A 32-bit signed integer hash code.

Definition at line 111 of file UIntPtr.cs.

◆ GetObjectData()

unsafe void ISerializable. System.UIntPtr.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Populates a T:System.Runtime.Serialization.SerializationInfo object with the data needed to serialize the current T:System.UIntPtr object.

Parameters
infoThe T:System.Runtime.Serialization.SerializationInfo object to populate with data.
contextThe destination for this serialization. (This parameter is not used; specify null.)
Exceptions
T:System.ArgumentNullExceptioninfo is null.

Implements System.Runtime.Serialization.ISerializable.

Definition at line 83 of file UIntPtr.cs.

◆ operator !=()

static unsafe bool System.UIntPtr.operator != ( UIntPtr  value1,
UIntPtr  value2 
)
static

Determines whether two specified instances of T:System.UIntPtr are not equal.

Parameters
value1The first pointer or handle to compare.
value2The second pointer or handle to compare.
Returns
true if value1 does not equal value2 ; otherwise, false.

Definition at line 229 of file UIntPtr.cs.

◆ operator -()

static UIntPtr System.UIntPtr.operator - ( UIntPtr  pointer,
int  offset 
)
static

Subtracts an offset from the value of an unsigned pointer.

Parameters
pointerThe unsigned pointer to subtract the offset from.
offsetThe offset to subtract.
Returns
A new unsigned pointer that reflects the subtraction of offset from pointer .

Definition at line 269 of file UIntPtr.cs.

◆ operator uint()

static unsafe System.UIntPtr.operator uint ( UIntPtr  value)
explicitstatic

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

Parameters
valueThe pointer or handle to convert.
Returns
The contents of value .
Exceptions
T:System.OverflowExceptionOn a 64-bit platform, the value of value is too large to represent as a 32-bit unsigned integer.

Definition at line 171 of file UIntPtr.cs.

◆ operator UIntPtr() [1/3]

static System.UIntPtr.operator UIntPtr ( uint  value)
explicitstatic

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

Parameters
valueA 32-bit unsigned integer.
Returns
A new instance of T:System.UIntPtr initialized to value .

Definition at line 150 of file UIntPtr.cs.

◆ operator UIntPtr() [2/3]

static System.UIntPtr.operator UIntPtr ( ulong  value)
explicitstatic

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

Parameters
valueA 64-bit unsigned integer.
Returns
A new instance of T:System.UIntPtr initialized to value .
Exceptions
T:System.OverflowExceptionOn a 32-bit platform, value is too large to represent as an T:System.UIntPtr.

Definition at line 160 of file UIntPtr.cs.

◆ operator UIntPtr() [3/3]

static unsafe System.UIntPtr.operator UIntPtr ( void *  value)
explicitstatic

Converts the specified pointer to an unspecified type to a T:System.UIntPtr.

Parameters
valueA pointer to an unspecified type.
Returns
A new instance of T:System.UIntPtr initialized to value .

Definition at line 192 of file UIntPtr.cs.

◆ operator ulong()

static unsafe System.UIntPtr.operator ulong ( UIntPtr  value)
explicitstatic

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

Parameters
valueThe pointer or handle to convert.
Returns
The contents of value .

Definition at line 181 of file UIntPtr.cs.

◆ operator void *()

static unsafe System.UIntPtr.operator void * ( UIntPtr  value)
explicitstatic

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

Parameters
valueThe pointer or handle to convert.
Returns
The contents of value .

Definition at line 203 of file UIntPtr.cs.

◆ operator+()

static UIntPtr System.UIntPtr.operator+ ( UIntPtr  pointer,
int  offset 
)
static

Adds an offset to the value of an unsigned pointer.

Parameters
pointerThe unsigned pointer to add the offset to.
offsetThe offset to add.
Returns
A new unsigned pointer that reflects the addition of offset to pointer .

Definition at line 249 of file UIntPtr.cs.

◆ operator==()

static unsafe bool System.UIntPtr.operator== ( UIntPtr  value1,
UIntPtr  value2 
)
static

Determines whether two specified instances of T:System.UIntPtr are equal.

Parameters
value1The first pointer or handle to compare.
value2The second pointer or handle to compare.
Returns
true if value1 equals value2 ; otherwise, false.

Definition at line 216 of file UIntPtr.cs.

◆ Subtract()

static UIntPtr System.UIntPtr.Subtract ( UIntPtr  pointer,
int  offset 
)
static

Subtracts an offset from the value of an unsigned pointer.

Parameters
pointerThe unsigned pointer to subtract the offset from.
offsetThe offset to subtract.
Returns
A new unsigned pointer that reflects the subtraction of offset from pointer .

Definition at line 259 of file UIntPtr.cs.

◆ ToPointer()

unsafe void* System.UIntPtr.ToPointer ( )

Converts the value of this instance to a pointer to an unspecified type.

Returns
A pointer to T:System.Void; that is, a pointer to memory containing data of an unspecified type.

Definition at line 279 of file UIntPtr.cs.

◆ ToString()

unsafe override string System.UIntPtr.ToString ( )

Converts the numeric value of this instance to its equivalent string representation.

Returns
The string representation of the value of this instance.

Definition at line 141 of file UIntPtr.cs.

◆ ToUInt32()

unsafe uint System.UIntPtr.ToUInt32 ( )

Converts the value of this instance to a 32-bit unsigned integer.

Returns
A 32-bit unsigned integer equal to the value of this instance.
Exceptions
T:System.OverflowExceptionOn a 64-bit platform, the value of this instance is too large to represent as a 32-bit unsigned integer.

Definition at line 122 of file UIntPtr.cs.

◆ ToUInt64()

unsafe ulong System.UIntPtr.ToUInt64 ( )

Converts the value of this instance to a 64-bit unsigned integer.

Returns
A 64-bit unsigned integer equal to the value of this instance.

Definition at line 132 of file UIntPtr.cs.

Member Data Documentation

◆ Zero

readonly UIntPtr System.UIntPtr.Zero
static

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

Definition at line 20 of file UIntPtr.cs.

Property Documentation

◆ Size

int System.UIntPtr.Size
staticget

Gets the size of this instance.

Returns
The size of a pointer or handle on this platform, measured in bytes. The value of this property is 4 on a 32-bit platform, and 8 on a 64-bit platform.

Definition at line 26 of file UIntPtr.cs.


The documentation for this struct was generated from the following file: