Files
27Aug2021-Cpp2IL-Dump/mscorlib/System/Runtime/InteropServices/SafeHandle.cs
T
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

204 lines
8.8 KiB
C#

using System;
using System.Runtime.ConstrainedExecution;
using Cpp2IlInjected;
namespace System.Runtime.InteropServices
{
/// <summary>Represents a wrapper class for operating system handles. This class must be inherited.</summary>
// Token: 0x020005A4 RID: 1444
[Token(Token = "0x20005A4")]
[StructLayout(0)]
public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.SafeHandle" /> class with the specified invalid handle value.</summary>
/// <param name="invalidHandleValue">The value of an invalid handle (usually 0 or -1). Your implementation of <see cref="P:System.Runtime.InteropServices.SafeHandle.IsInvalid" /> should return <see langword="true" /> for this value.</param>
/// <param name="ownsHandle">
/// <see langword="true" /> to reliably let <see cref="T:System.Runtime.InteropServices.SafeHandle" /> release the handle during the finalization phase; otherwise, <see langword="false" /> (not recommended).</param>
/// <exception cref="T:System.TypeLoadException">The derived class resides in an assembly without unmanaged code access permission.</exception>
// Token: 0x06002CD9 RID: 11481 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CD9")]
[Address(RVA = "0x2CFCDC0", Offset = "0x2CFBDC0", VA = "0x182CFCDC0")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected SafeHandle(IntPtr invalidHandleValue, bool ownsHandle)
{
}
/// <summary>Frees all resources associated with the handle.</summary>
// Token: 0x06002CDA RID: 11482 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CDA")]
[Address(RVA = "0x2CFCBC0", Offset = "0x2CFBBC0", VA = "0x182CFCBC0", Slot = "1")]
protected override void Finalize()
{
}
/// <summary>Sets the handle to the specified pre-existing handle.</summary>
/// <param name="handle">The pre-existing handle to use.</param>
// Token: 0x06002CDB RID: 11483 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CDB")]
[Address(RVA = "0x415800", Offset = "0x414800", VA = "0x180415800")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
protected void SetHandle(IntPtr handle)
{
}
/// <summary>Returns the value of the <see cref="F:System.Runtime.InteropServices.SafeHandle.handle" /> field.</summary>
/// <returns>An <see langword="IntPtr" /> representing the value of the <see cref="F:System.Runtime.InteropServices.SafeHandle.handle" /> field. If the handle has been marked invalid with <see cref="M:System.Runtime.InteropServices.SafeHandle.SetHandleAsInvalid" />, this method still returns the original handle value, which can be a stale value.</returns>
// Token: 0x06002CDC RID: 11484 RVA: 0x00018E40 File Offset: 0x00017040
[Token(Token = "0x6002CDC")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public IntPtr DangerousGetHandle()
{
return 0;
}
/// <summary>Gets a value indicating whether the handle is closed.</summary>
/// <returns>
/// <see langword="true" /> if the handle is closed; otherwise, <see langword="false" />.</returns>
// Token: 0x170006CB RID: 1739
// (get) Token: 0x06002CDD RID: 11485 RVA: 0x00018E58 File Offset: 0x00017058
[Token(Token = "0x170006CB")]
public bool IsClosed
{
[Token(Token = "0x6002CDD")]
[Address(RVA = "0x2CFCE50", Offset = "0x2CFBE50", VA = "0x182CFCE50")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get
{
return default(bool);
}
}
/// <summary>When overridden in a derived class, gets a value indicating whether the handle value is invalid.</summary>
/// <returns>
/// <see langword="true" /> if the handle value is invalid; otherwise, <see langword="false" />.</returns>
// Token: 0x170006CC RID: 1740
// (get) Token: 0x06002CDE RID: 11486
[Token(Token = "0x170006CC")]
public abstract bool IsInvalid
{
[Token(Token = "0x6002CDE")]
[Address(Slot = "5")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
get;
}
/// <summary>Marks the handle for releasing and freeing resources.</summary>
// Token: 0x06002CDF RID: 11487 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CDF")]
[Address(RVA = "0x2BA3AB0", Offset = "0x2BA2AB0", VA = "0x182BA3AB0")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public void Close()
{
}
/// <summary>Releases all resources used by the <see cref="T:System.Runtime.InteropServices.SafeHandle" /> class.</summary>
// Token: 0x06002CE0 RID: 11488 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE0")]
[Address(RVA = "0x2BA3AB0", Offset = "0x2BA2AB0", VA = "0x182BA3AB0", Slot = "4")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public void Dispose()
{
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Runtime.InteropServices.SafeHandle" /> class specifying whether to perform a normal dispose operation.</summary>
/// <param name="disposing">
/// <see langword="true" /> for a normal dispose operation; <see langword="false" /> to finalize the handle.</param>
// Token: 0x06002CE1 RID: 11489 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE1")]
[Address(RVA = "0x2CFCB10", Offset = "0x2CFBB10", VA = "0x182CFCB10", Slot = "6")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
protected virtual void Dispose(bool disposing)
{
}
/// <summary>When overridden in a derived class, executes the code required to free the handle.</summary>
/// <returns>
/// <see langword="true" /> if the handle is released successfully; otherwise, in the event of a catastrophic failure, <see langword="false" />. In this case, it generates a releaseHandleFailed Managed Debugging Assistant.</returns>
// Token: 0x06002CE2 RID: 11490
[Token(Token = "0x6002CE2")]
[Address(Slot = "7")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
protected abstract bool ReleaseHandle();
/// <summary>Marks a handle as no longer used.</summary>
// Token: 0x06002CE3 RID: 11491 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE3")]
[Address(RVA = "0x2CFCCF0", Offset = "0x2CFBCF0", VA = "0x182CFCCF0")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public void SetHandleAsInvalid()
{
}
/// <summary>Manually increments the reference counter on <see cref="T:System.Runtime.InteropServices.SafeHandle" /> instances.</summary>
/// <param name="success">
/// <see langword="true" /> if the reference counter was successfully incremented; otherwise, <see langword="false" />.</param>
// Token: 0x06002CE4 RID: 11492 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE4")]
[Address(RVA = "0x2CFC850", Offset = "0x2CFB850", VA = "0x182CFC850")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public void DangerousAddRef(ref bool success)
{
}
/// <summary>Manually decrements the reference counter on a <see cref="T:System.Runtime.InteropServices.SafeHandle" /> instance.</summary>
// Token: 0x06002CE5 RID: 11493 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE5")]
[Address(RVA = "0x2CFCB00", Offset = "0x2CFBB00", VA = "0x182CFCB00")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public void DangerousRelease()
{
}
// Token: 0x06002CE6 RID: 11494 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE6")]
[Address(RVA = "0x2CFCC40", Offset = "0x2CFBC40", VA = "0x182CFCC40")]
private void InternalDispose()
{
}
// Token: 0x06002CE7 RID: 11495 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE7")]
[Address(RVA = "0x2CFCCD0", Offset = "0x2CFBCD0", VA = "0x182CFCCD0")]
private void InternalFinalize()
{
}
// Token: 0x06002CE8 RID: 11496 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6002CE8")]
[Address(RVA = "0x2CFC960", Offset = "0x2CFB960", VA = "0x182CFC960")]
private void DangerousReleaseInternal(bool dispose)
{
}
/// <summary>Specifies the handle to be wrapped.</summary>
// Token: 0x040019F8 RID: 6648
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x40019F8")]
protected IntPtr handle;
// Token: 0x040019F9 RID: 6649
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x40019F9")]
private int _state;
// Token: 0x040019FA RID: 6650
[FieldOffset(Offset = "0x1C")]
[Token(Token = "0x40019FA")]
private bool _ownsHandle;
// Token: 0x040019FB RID: 6651
[FieldOffset(Offset = "0x1D")]
[Token(Token = "0x40019FB")]
private bool _fullyInitialized;
// Token: 0x040019FC RID: 6652
[Token(Token = "0x40019FC")]
private const int RefCount_Mask = 2147483644;
// Token: 0x040019FD RID: 6653
[Token(Token = "0x40019FD")]
private const int RefCount_One = 4;
}
}