using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System
{
/// A platform-specific type that is used to represent a pointer or a handle.
/// 1
// Token: 0x02000025 RID: 37
[ComVisible(true)]
[CLSCompliant(false)]
[Serializable]
public struct UIntPtr : ISerializable
{
/// Initializes a new instance of using the specified 64-bit pointer or handle.
/// A pointer or handle contained in a 64-bit unsigned integer.
/// On a 32-bit platform, is too large to represent as an .
// Token: 0x06000373 RID: 883 RVA: 0x0000DA5C File Offset: 0x0000BC5C
public UIntPtr(ulong value)
{
if (value > (ulong)(-1) && UIntPtr.Size < 8)
{
throw new OverflowException(Locale.GetText("This isn't a 64bits machine."));
}
this._pointer = value;
}
/// Initializes a new instance of the structure using the specified 32-bit pointer or handle.
/// A pointer or handle contained in a 32-bit unsigned integer.
// Token: 0x06000374 RID: 884 RVA: 0x0000DA8C File Offset: 0x0000BC8C
public UIntPtr(uint value)
{
this._pointer = value;
}
/// Initializes a new instance of using the specified pointer to an unspecified type.
/// A pointer to an unspecified type.
// Token: 0x06000375 RID: 885 RVA: 0x0000DA98 File Offset: 0x0000BC98
[CLSCompliant(false)]
public unsafe UIntPtr(void* value)
{
this._pointer = value;
}
/// Populates a object with the data needed to serialize the current object.
/// The object to populate with data.
/// The destination for this serialization. (This parameter is not used; specify null.)
///
/// is null.
// Token: 0x06000377 RID: 887 RVA: 0x0000DAB4 File Offset: 0x0000BCB4
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
info.AddValue("pointer", this._pointer);
}
/// Returns a value indicating whether this instance is equal to a specified object.
/// true if is an instance of and equals the value of this instance; otherwise, false.
/// An object to compare with this instance or null.
/// 2
// Token: 0x06000378 RID: 888 RVA: 0x0000DADC File Offset: 0x0000BCDC
public override bool Equals(object obj)
{
if (obj is UIntPtr)
{
UIntPtr uintPtr = (UIntPtr)obj;
return this._pointer == uintPtr._pointer;
}
return false;
}
/// Returns the hash code for this instance.
/// A 32-bit signed integer hash code.
/// 2
// Token: 0x06000379 RID: 889 RVA: 0x0000DB0C File Offset: 0x0000BD0C
public override int GetHashCode()
{
return this._pointer;
}
/// Converts the value of this instance to a 32-bit unsigned integer.
/// A 32-bit unsigned integer equal to the value of this instance.
/// On a 64-bit platform, the value of this instance is too large to represent as a 32-bit unsigned integer.
/// 1
// Token: 0x0600037A RID: 890 RVA: 0x0000DB18 File Offset: 0x0000BD18
public uint ToUInt32()
{
return this._pointer;
}
/// Converts the value of this instance to a 64-bit unsigned integer.
/// A 64-bit unsigned integer equal to the value of this instance.
/// 1
// Token: 0x0600037B RID: 891 RVA: 0x0000DB24 File Offset: 0x0000BD24
public ulong ToUInt64()
{
return this._pointer;
}
/// Converts the value of this instance to a pointer to an unspecified type.
/// A pointer to ; that is, a pointer to memory containing data of an unspecified type.
/// 1
// Token: 0x0600037C RID: 892 RVA: 0x0000DB30 File Offset: 0x0000BD30
[CLSCompliant(false)]
public unsafe void* ToPointer()
{
return this._pointer;
}
/// Converts the numeric value of this instance to its equivalent string representation.
/// The string representation of the value of this instance.
/// 1
// Token: 0x0600037D RID: 893 RVA: 0x0000DB38 File Offset: 0x0000BD38
public override string ToString()
{
return this._pointer.ToString();
}
/// Gets the size of this instance.
/// 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.
/// 1
// Token: 0x1700000C RID: 12
// (get) Token: 0x0600037E RID: 894 RVA: 0x0000DB54 File Offset: 0x0000BD54
public unsafe static int Size
{
get
{
return sizeof(void*);
}
}
/// Determines whether two specified instances of are equal.
/// true if equals ; otherwise, false.
/// A .
/// A .
/// 3
// Token: 0x0600037F RID: 895 RVA: 0x0000DB5C File Offset: 0x0000BD5C
public static bool operator ==(UIntPtr value1, UIntPtr value2)
{
return value1._pointer == value2._pointer;
}
/// Determines whether two specified instances of are not equal.
/// true if does not equal ; otherwise, false.
/// A .
/// A .
/// 3
// Token: 0x06000380 RID: 896 RVA: 0x0000DB70 File Offset: 0x0000BD70
public static bool operator !=(UIntPtr value1, UIntPtr value2)
{
return value1._pointer != value2._pointer;
}
/// Converts the value of the specified to a 64-bit unsigned integer.
/// The contents of .
/// A .
/// 3
// Token: 0x06000381 RID: 897 RVA: 0x0000DB88 File Offset: 0x0000BD88
public static explicit operator ulong(UIntPtr value)
{
return value._pointer;
}
/// Converts the value of the specified to a 32-bit unsigned integer.
/// The contents of .
/// A .
/// On a 64-bit platform, the value of is too large to represent as a 32-bit unsigned integer.
/// 3
// Token: 0x06000382 RID: 898 RVA: 0x0000DB94 File Offset: 0x0000BD94
public static explicit operator uint(UIntPtr value)
{
return value._pointer;
}
/// Converts the value of a 64-bit unsigned integer to an .
/// A new instance of initialized to .
/// A 64-bit unsigned integer.
/// On a 32-bit platform, is too large to represent as an .
/// 3
// Token: 0x06000383 RID: 899 RVA: 0x0000DBA0 File Offset: 0x0000BDA0
public static explicit operator UIntPtr(ulong value)
{
return new UIntPtr(value);
}
/// Converts the specified pointer to an unspecified type to a .
/// A new instance of initialized to .
/// A pointer to an unspecified type.
/// 3
// Token: 0x06000384 RID: 900 RVA: 0x0000DBA8 File Offset: 0x0000BDA8
[CLSCompliant(false)]
public unsafe static explicit operator UIntPtr(void* value)
{
return new UIntPtr(value);
}
/// Converts the value of the specified to a pointer to an unspecified type.
/// The contents of .
/// A .
/// 3
// Token: 0x06000385 RID: 901 RVA: 0x0000DBB0 File Offset: 0x0000BDB0
[CLSCompliant(false)]
public unsafe static explicit operator void*(UIntPtr value)
{
return value.ToPointer();
}
/// Converts the value of a 32-bit unsigned integer to an .
/// A new instance of initialized to .
/// A 32-bit unsigned integer.
/// 3
// Token: 0x06000386 RID: 902 RVA: 0x0000DBBC File Offset: 0x0000BDBC
public static explicit operator UIntPtr(uint value)
{
return new UIntPtr(value);
}
/// A read-only field that represents a pointer or handle that has been initialized to zero.
/// 1
// Token: 0x04000058 RID: 88
public static readonly UIntPtr Zero = new UIntPtr(0U);
// Token: 0x04000059 RID: 89
private unsafe void* _pointer;
}
}