UIntPtr 구조체

정의

중요

이 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
상속
UIntPtr
특성
구현
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 형식을 참조하세요.

C#에서는 버전 11부터 .NET 7 이상 런타임 nuint 을 대상으로 하는 경우 별칭과 같은 방식으로 uint 별칭 UIntPtr 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)

두 값의 몫과 나머지를 계산합니다.

Equals(Object)

이 인스턴스가 지정된 개체와 같은지를 표시하는 값을 반환합니다.

Equals(UIntPtr)

현재 개체가 동일한 형식의 다른 개체와 같은지 여부를 나타냅니다.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

IsEvenInteger(UIntPtr)

값이 짝수 정수인지 여부를 결정합니다.

IsOddInteger(UIntPtr)

값이 홀수 정수인지 여부를 결정합니다.

IsPow2(UIntPtr)

값이 2의 힘인지 여부를 확인합니다.

LeadingZeroCount(UIntPtr)

값의 선행 0 수를 계산합니다.

Log2(UIntPtr)

값의 log2를 계산합니다.

Max(UIntPtr, UIntPtr)

두 값을 더 큰 컴퓨팅과 비교합니다.

Min(UIntPtr, UIntPtr)

두 값을 더 작은 컴퓨팅과 비교합니다.

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)

값의 후행 0 수를 계산합니다.

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의 지정된 두 인스턴스가 같은지를 확인합니다.

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의 지정된 두 인스턴스가 다른지를 확인합니다.

Subtraction(UIntPtr, Int32)

부호 없는 정수에서 오프셋을 뺍니다.

명시적 인터페이스 구현

IBinaryInteger<UIntPtr>.GetByteCount()

의 일부로 TryWriteLittleEndian(Span<Byte>, Int32)작성될 바이트 수를 가져옵니다.

IBinaryInteger<UIntPtr>.GetShortestBitLength()

현재 값의 가장 짧은 두 개의 보수 표현의 길이(비트)를 가져옵니다.

IBinaryInteger<UIntPtr>.TryWriteBigEndian(Span<Byte>, Int32)

현재 값(big-endian 형식)을 지정된 범위에 쓰려고 시도합니다.

IBinaryInteger<UIntPtr>.TryWriteLittleEndian(Span<Byte>, Int32)

현재 값(little-endian 형식)을 지정된 범위에 쓰려고 시도합니다.

IEquatable<UIntPtr>.Equals(UIntPtr)

이 인스턴스가 부호 없는 다른 정수와 같은지 여부를 나타내는 값을 반환합니다.

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

현재 SerializationInfo 개체를 serialize하는 데 필요한 데이터로 UIntPtr 개체를 채웁니다.

적용 대상

스레드 보안

이 형식은 스레드로부터 안전합니다.

추가 정보