UIntPtr 構造体
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
重要
この API は CLS 準拠ではありません。
ビット幅がポインターと同じ符号なし整数を表します。
public value class UIntPtr
public value class UIntPtr : IComparable, IComparable<UIntPtr>, IEquatable<UIntPtr>, IFormattable, System::Runtime::Serialization::ISerializable
public value class UIntPtr : IComparable, IComparable<UIntPtr>, IEquatable<UIntPtr>, ISpanFormattable, System::Runtime::Serialization::ISerializable
public value class UIntPtr : IComparable<UIntPtr>, IEquatable<UIntPtr>, IParsable<UIntPtr>, ISpanParsable<UIntPtr>, System::Numerics::IAdditionOperators<UIntPtr, UIntPtr, UIntPtr>, System::Numerics::IAdditiveIdentity<UIntPtr, UIntPtr>, System::Numerics::IBinaryInteger<UIntPtr>, System::Numerics::IBinaryNumber<UIntPtr>, System::Numerics::IBitwiseOperators<UIntPtr, UIntPtr, UIntPtr>, System::Numerics::IComparisonOperators<UIntPtr, UIntPtr>, System::Numerics::IDecrementOperators<UIntPtr>, System::Numerics::IDivisionOperators<UIntPtr, UIntPtr, UIntPtr>, System::Numerics::IEqualityOperators<UIntPtr, UIntPtr>, System::Numerics::IIncrementOperators<UIntPtr>, System::Numerics::IMinMaxValue<UIntPtr>, System::Numerics::IModulusOperators<UIntPtr, UIntPtr, UIntPtr>, System::Numerics::IMultiplicativeIdentity<UIntPtr, UIntPtr>, System::Numerics::IMultiplyOperators<UIntPtr, UIntPtr, UIntPtr>, System::Numerics::INumber<UIntPtr>, System::Numerics::INumberBase<UIntPtr>, System::Numerics::IShiftOperators<UIntPtr, UIntPtr>, System::Numerics::ISubtractionOperators<UIntPtr, UIntPtr, UIntPtr>, System::Numerics::IUnaryNegationOperators<UIntPtr, UIntPtr>, System::Numerics::IUnaryPlusOperators<UIntPtr, UIntPtr>, System::Numerics::IUnsignedNumber<UIntPtr>, System::Runtime::Serialization::ISerializable
public value class UIntPtr : IEquatable<UIntPtr>, System::Runtime::Serialization::ISerializable
public value class UIntPtr : System::Runtime::Serialization::ISerializable
[System.CLSCompliant(false)]
public struct UIntPtr
[System.CLSCompliant(false)]
public readonly struct UIntPtr : IComparable, IComparable<UIntPtr>, IEquatable<UIntPtr>, IFormattable, System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
public readonly struct UIntPtr : IComparable, IComparable<UIntPtr>, IEquatable<UIntPtr>, ISpanFormattable, System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
public readonly struct UIntPtr : IComparable<UIntPtr>, IEquatable<UIntPtr>, IParsable<UIntPtr>, ISpanParsable<UIntPtr>, System.Numerics.IAdditionOperators<UIntPtr,UIntPtr,UIntPtr>, System.Numerics.IAdditiveIdentity<UIntPtr,UIntPtr>, System.Numerics.IBinaryInteger<UIntPtr>, System.Numerics.IBinaryNumber<UIntPtr>, System.Numerics.IBitwiseOperators<UIntPtr,UIntPtr,UIntPtr>, System.Numerics.IComparisonOperators<UIntPtr,UIntPtr>, System.Numerics.IDecrementOperators<UIntPtr>, System.Numerics.IDivisionOperators<UIntPtr,UIntPtr,UIntPtr>, System.Numerics.IEqualityOperators<UIntPtr,UIntPtr>, System.Numerics.IIncrementOperators<UIntPtr>, System.Numerics.IMinMaxValue<UIntPtr>, System.Numerics.IModulusOperators<UIntPtr,UIntPtr,UIntPtr>, System.Numerics.IMultiplicativeIdentity<UIntPtr,UIntPtr>, System.Numerics.IMultiplyOperators<UIntPtr,UIntPtr,UIntPtr>, System.Numerics.INumber<UIntPtr>, System.Numerics.INumberBase<UIntPtr>, System.Numerics.IShiftOperators<UIntPtr,UIntPtr>, System.Numerics.ISubtractionOperators<UIntPtr,UIntPtr,UIntPtr>, System.Numerics.IUnaryNegationOperators<UIntPtr,UIntPtr>, System.Numerics.IUnaryPlusOperators<UIntPtr,UIntPtr>, System.Numerics.IUnsignedNumber<UIntPtr>, System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
public struct UIntPtr : IEquatable<UIntPtr>, System.Runtime.Serialization.ISerializable
[System.CLSCompliant(false)]
public readonly 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
[<System.CLSCompliant(false)>]
type unativeint = struct
[<System.CLSCompliant(false)>]
type unativeint = struct
interface IFormattable
interface ISerializable
[<System.CLSCompliant(false)>]
type unativeint = struct
interface ISpanFormattable
interface IFormattable
interface ISerializable
[<System.CLSCompliant(false)>]
type unativeint = struct
interface IFormattable
interface IParsable<unativeint>
interface ISpanFormattable
interface ISpanParsable<unativeint>
interface IAdditionOperators<unativeint, unativeint, unativeint>
interface IAdditiveIdentity<unativeint, unativeint>
interface IBinaryInteger<unativeint>
interface IBinaryNumber<unativeint>
interface IBitwiseOperators<unativeint, unativeint, unativeint>
interface IComparisonOperators<unativeint, unativeint>
interface IEqualityOperators<unativeint, unativeint>
interface IDecrementOperators<unativeint>
interface IDivisionOperators<unativeint, unativeint, unativeint>
interface IIncrementOperators<unativeint>
interface IModulusOperators<unativeint, unativeint, unativeint>
interface IMultiplicativeIdentity<unativeint, unativeint>
interface IMultiplyOperators<unativeint, unativeint, unativeint>
interface INumber<unativeint>
interface INumberBase<unativeint>
interface ISubtractionOperators<unativeint, unativeint, unativeint>
interface IUnaryNegationOperators<unativeint, unativeint>
interface IUnaryPlusOperators<unativeint, unativeint>
interface IShiftOperators<unativeint, unativeint>
interface IMinMaxValue<unativeint>
interface IUnsignedNumber<unativeint>
interface ISerializable
[<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 IComparable, IComparable(Of UIntPtr), IEquatable(Of UIntPtr), ISerializable, ISpanFormattable
Public Structure UIntPtr
Implements IAdditionOperators(Of UIntPtr, UIntPtr, UIntPtr), IAdditiveIdentity(Of UIntPtr, UIntPtr), IBinaryInteger(Of UIntPtr), IBinaryNumber(Of UIntPtr), IBitwiseOperators(Of UIntPtr, UIntPtr, UIntPtr), IComparable(Of UIntPtr), IComparisonOperators(Of UIntPtr, UIntPtr), IDecrementOperators(Of UIntPtr), IDivisionOperators(Of UIntPtr, UIntPtr, UIntPtr), IEqualityOperators(Of UIntPtr, UIntPtr), IEquatable(Of UIntPtr), IIncrementOperators(Of UIntPtr), IMinMaxValue(Of UIntPtr), IModulusOperators(Of UIntPtr, UIntPtr, UIntPtr), IMultiplicativeIdentity(Of UIntPtr, UIntPtr), IMultiplyOperators(Of UIntPtr, UIntPtr, UIntPtr), INumber(Of UIntPtr), INumberBase(Of UIntPtr), IParsable(Of UIntPtr), ISerializable, IShiftOperators(Of UIntPtr, UIntPtr), ISpanParsable(Of UIntPtr), ISubtractionOperators(Of UIntPtr, UIntPtr, UIntPtr), IUnaryNegationOperators(Of UIntPtr, UIntPtr), IUnaryPlusOperators(Of UIntPtr, UIntPtr), IUnsignedNumber(Of UIntPtr)
Public Structure UIntPtr
Implements IEquatable(Of UIntPtr), ISerializable
Public Structure UIntPtr
Implements ISerializable
- 継承
- 属性
- 実装
-
IComparable IComparable<UIntPtr> IEquatable<UIntPtr> IFormattable ISerializable ISpanFormattable IComparable<TOther> IComparable<TSelf> IEquatable<TOther> IEquatable<TSelf> IParsable<UIntPtr> IParsable<TSelf> ISpanParsable<UIntPtr> ISpanParsable<TSelf> IAdditionOperators<UIntPtr,UIntPtr,UIntPtr> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<UIntPtr,UIntPtr> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<UIntPtr> IBinaryNumber<UIntPtr> IBinaryNumber<TSelf> IBitwiseOperators<UIntPtr,UIntPtr,UIntPtr> IBitwiseOperators<TSelf,TSelf,TSelf> System.Numerics.IComparisonOperators<UIntPtr,UIntPtr> System.Numerics.IComparisonOperators<TSelf,TSelf> IDecrementOperators<UIntPtr> IDecrementOperators<TSelf> IDivisionOperators<UIntPtr,UIntPtr,UIntPtr> IDivisionOperators<TSelf,TSelf,TSelf> System.Numerics.IEqualityOperators<UIntPtr,UIntPtr> System.Numerics.IEqualityOperators<TSelf,TOther> System.Numerics.IEqualityOperators<TSelf,TSelf> IIncrementOperators<UIntPtr> IIncrementOperators<TSelf> IMinMaxValue<UIntPtr> IModulusOperators<UIntPtr,UIntPtr,UIntPtr> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<UIntPtr,UIntPtr> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<UIntPtr,UIntPtr,UIntPtr> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<UIntPtr> INumber<TSelf> INumberBase<UIntPtr> INumberBase<TSelf> System.Numerics.IShiftOperators<UIntPtr,UIntPtr> System.Numerics.IShiftOperators<TSelf,TSelf> ISubtractionOperators<UIntPtr,UIntPtr,UIntPtr> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<UIntPtr,UIntPtr> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<UIntPtr,UIntPtr> IUnaryPlusOperators<TSelf,TSelf> IUnsignedNumber<UIntPtr>
注釈
型は UIntPtr 、サイズがポインターと同じ整数に設計されています。 つまり、この型のインスタンスは、32 ビット プロセスでは 32 ビット、64 ビット プロセスでは 64 ビットであると想定されます。
型は UIntPtr 、ポインターをサポートする言語で使用でき、ポインターをサポートする言語とサポートしていない言語の間でデータを参照する一般的な手段として使用できます。 UIntPtr オブジェクトを使用してハンドルを保持することもできます。
注意
ポインターまたはハンドルとして使用すると UIntPtr 、エラーが発生しやすく、安全ではありません。 これは単なる整数型であり、同じサイズであるため、ポインターとハンドルのインターチェンジ形式として使用できます。 ポインターをサポートしていない言語にデータを渡すなど、特定のインターチェンジ要件以外では、ポインターを表すために正しく型指定されたポインターを使用し、 SafeHandle ハンドルを表すために使用する必要があります。
この型では、 ISerializable. .NET 5 以降のバージョンでは、この型はインターフェイスも実装します IFormattable 。 .NET 7 以降のバージョンでは、この型は 、、IMinMaxValue<TSelf>およびIUnsignedNumber<TSelf>インターフェイスも実装IBinaryInteger<TSelf>します。
バージョン 9.0 以降の C# では、組 nuint
み込み型を使用してネイティブ サイズの整数を定義できます。 この型は内部的に UIntPtr 型によって表され、整数型に適した演算と変換を提供します。 詳細については、「 nint 型と nuint 型」を参照してください。
バージョン 11 以降の C# では、.NET 7 以降のランタイムを対象とする場合は、 nuint
UIntPtr エイリアスと同じ方法 uint
でエイリアス UInt32になります。
コンストラクター
UIntPtr(UInt32) |
指定した 32 ビット符号なし整数を UIntPtr 使用して、構造体の新しいインスタンスを初期化します。 |
UIntPtr(UInt64) |
指定した 64 ビット符号なし整数を使用して、新しいインスタンス UIntPtr を初期化します。 |
UIntPtr(Void*) |
指定されていない型へのポインターを使用して、UIntPtr の新しいインスタンスを初期化します。 |
フィールド
Zero |
0 に初期化された符号なし整数を表す読み取り専用フィールド。 |
プロパティ
MaxValue |
UIntPtr の最大有効値を表します。 |
MinValue |
UIntPtr の最小有効値を表します。 |
Size |
このインスタンスのサイズを取得します。 |
メソッド
Add(UIntPtr, Int32) |
符号なし整数にオフセットを追加します。 |
Clamp(UIntPtr, UIntPtr, UIntPtr) |
値を包括的な最小値と最大値にクランプします。 |
CompareTo(Object) |
現在のインスタンスを同じ型の別のオブジェクトと比較し、現在のインスタンスの並べ替え順序での位置が、比較対象のオブジェクトと比べて前か、後か、または同じかを示す整数を返します。 |
CompareTo(UIntPtr) |
現在のインスタンスを同じ型の別のオブジェクトと比較し、現在のインスタンスの並べ替え順序での位置が、比較対象のオブジェクトと比べて前か、後か、または同じかを示す整数を返します。 |
DivRem(UIntPtr, UIntPtr) |
商と 2 つの値の剰余を計算します。 |
Equals(Object) |
このインスタンスが指定されたオブジェクトに等しいかどうかを示す値を返します。 |
Equals(UIntPtr) |
現在のオブジェクトが、同じ型の別のオブジェクトと等しいかどうかを示します。 |
GetHashCode() |
このインスタンスのハッシュ コードを返します。 |
IsEvenInteger(UIntPtr) |
値が偶数の整数を表すかどうかを判断します。 |
IsOddInteger(UIntPtr) |
値が奇数の整数を表すかどうかを判断します。 |
IsPow2(UIntPtr) |
値が 2 の累乗であるかどうかを判断します。 |
LeadingZeroCount(UIntPtr) |
値の先頭のゼロの数を計算します。 |
Log2(UIntPtr) |
値の log2 を計算します。 |
Max(UIntPtr, UIntPtr) |
2 つの値を比較して、より大きい計算を行います。 |
Min(UIntPtr, UIntPtr) |
2 つの値を比較して、より小さいコンピューティングを行います。 |
Parse(ReadOnlySpan<Char>, IFormatProvider) | |
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
必要に応じて指定したスタイルで、必要に応じて指定されたカルチャ固有の形式の数値の文字表現の読み取り専用スパンを、それと同等の符号なしネイティブ整数に変換します。 |
Parse(String) |
数値の文字列形式を、それと等価な符号なしネイティブ整数に変換します。 |
Parse(String, IFormatProvider) |
指定されたカルチャに固有の書式による数値の文字列形式を、それと等価な符号なしネイティブ整数に変換します。 |
Parse(String, NumberStyles) |
指定したスタイルの数値の文字列形式を、それと等価な符号なしネイティブ整数に変換します。 |
Parse(String, NumberStyles, IFormatProvider) |
指定されたスタイルとカルチャに固有の書式による数値の文字列形式を、それと等価な符号なしネイティブ整数に変換します。 |
PopCount(UIntPtr) |
値に設定されているビット数を計算します。 |
RotateLeft(UIntPtr, Int32) |
指定した量の値を左方向に回転します。 |
RotateRight(UIntPtr, Int32) |
指定した量の値を右方向に回転します。 |
Sign(UIntPtr) |
値の符号を計算します。 |
Subtract(UIntPtr, Int32) |
符号なし整数からオフセットを減算します。 |
ToPointer() |
このインスタンスの値を指定されていない型のポインターに変換します。 |
ToString() |
このインスタンスの数値を、それと等価な文字列形式に変換します。 |
ToString(IFormatProvider) |
このインスタンスの数値を、指定した書式およびカルチャ固有の書式情報を使用して、それと等価な文字列形式に変換します。 |
ToString(String) |
指定した書式を使用して、このインスタンスの数値を、それと等価な文字列形式に変換します。 |
ToString(String, IFormatProvider) |
指定された書式を使用して現在のインスタンスの値を書式設定します。 |
ToUInt32() |
このインスタンスの値を 32 ビット符号なし整数に変換します。 |
ToUInt64() |
このインスタンスの値を 64 ビット符号なし整数に変換します。 |
TrailingZeroCount(UIntPtr) |
値の末尾のゼロの数を計算します。 |
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
現在のインスタンスの値を指定された文字範囲に書式設定しようとします。 |
TryParse(ReadOnlySpan<Char>, IFormatProvider, UIntPtr) | |
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, UIntPtr) |
指定したスタイルおよびカルチャ固有の形式の数値の文字表現の読み取り専用スパンを、等価の符号なしネイティブ整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
TryParse(ReadOnlySpan<Char>, UIntPtr) |
数値の文字表現の読み取り専用スパンを、等価の符号なしネイティブ整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
TryParse(String, IFormatProvider, UIntPtr) | |
TryParse(String, NumberStyles, IFormatProvider, UIntPtr) |
指定されたスタイルとカルチャに固有の書式による数値の文字列形式を、それと等価な符号なしネイティブ整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
TryParse(String, UIntPtr) |
数値の文字列形式を、それと等価な符号なしネイティブ整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
演算子
Addition(UIntPtr, Int32) |
符号なし整数にオフセットを追加します。 |
Equality(UIntPtr, UIntPtr) |
UIntPtr の 2 つの指定したインスタンスが等しいかどうかを判断します。 |
Explicit(UInt32 to UIntPtr) |
32 ビット符号なし整数の値を UIntPtr に変換します。 |
Explicit(UInt64 to UIntPtr) |
64 ビット符号なし整数の値を UIntPtr に変換します。 |
Explicit(UIntPtr to UInt32) |
指定した UIntPtr の値を 32 ビット符号なし整数に変換します。 |
Explicit(UIntPtr to UInt64) |
指定した UIntPtr の値を 64 ビット符号なし整数に変換します。 |
Explicit(UIntPtr to Void*) |
指定した UIntPtr の値を指定されていない型のポインターに変換します。 この API は、CLS に準拠していません。 |
Explicit(Void* to UIntPtr) |
指定されていない型の指定のポインターを UIntPtr に変換します。 この API は、CLS に準拠していません。 |
Inequality(UIntPtr, UIntPtr) |
UIntPtr の 2 つの指定したインスタンスが等しいかどうかを判断します。 |
Subtraction(UIntPtr, Int32) |
符号なし整数からオフセットを減算します。 |
明示的なインターフェイスの実装
IBinaryInteger<UIntPtr>.GetByteCount() |
の一部として書き込まれるバイト数を TryWriteLittleEndian(Span<Byte>, Int32)取得します。 |
IBinaryInteger<UIntPtr>.GetShortestBitLength() |
現在の値の最短 2 の補数表現の長さをビット単位で取得します。 |
IBinaryInteger<UIntPtr>.TryWriteBigEndian(Span<Byte>, Int32) |
現在の値をビッグ エンディアン形式で特定のスパンに書き込もうとします。 |
IBinaryInteger<UIntPtr>.TryWriteLittleEndian(Span<Byte>, Int32) |
現在の値をリトル エンディアン形式で特定のスパンに書き込もうとします。 |
IEquatable<UIntPtr>.Equals(UIntPtr) |
このインスタンスが別の符号なし整数と等しいかどうかを示す値を返します。 |
ISerializable.GetObjectData(SerializationInfo, StreamingContext) |
SerializationInfo オブジェクトに、現在の UIntPtr オブジェクトをシリアル化するために必要なすべてのデータを格納します。 |
適用対象
スレッド セーフ
この型はスレッド セーフです。