This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,31 @@
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace Microsoft.Win32.SafeHandles
{
/// <summary>Provides a base class for Win32 critical handle implementations in which the value of -1 indicates an invalid handle.</summary>
// Token: 0x0200006C RID: 108
public abstract class CriticalHandleMinusOneIsInvalid : CriticalHandle, IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Win32.SafeHandles.CriticalHandleMinusOneIsInvalid" /> class.</summary>
// Token: 0x060006E4 RID: 1764 RVA: 0x00015420 File Offset: 0x00013620
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected CriticalHandleMinusOneIsInvalid()
: base((IntPtr)(-1))
{
}
/// <summary>Gets a value that indicates whether the handle is invalid.</summary>
/// <returns>true if the handle is not valid; otherwise, false.</returns>
// Token: 0x170000CD RID: 205
// (get) Token: 0x060006E5 RID: 1765 RVA: 0x00015430 File Offset: 0x00013630
public override bool IsInvalid
{
get
{
return this.handle == (IntPtr)(-1);
}
}
}
}
@@ -0,0 +1,31 @@
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace Microsoft.Win32.SafeHandles
{
/// <summary>Provides a base class for Win32 critical handle implementations in which the value of either 0 or -1 indicates an invalid handle.</summary>
// Token: 0x0200006D RID: 109
public abstract class CriticalHandleZeroOrMinusOneIsInvalid : CriticalHandle, IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Win32.SafeHandles.CriticalHandleZeroOrMinusOneIsInvalid" /> class. </summary>
// Token: 0x060006E6 RID: 1766 RVA: 0x00015444 File Offset: 0x00013644
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected CriticalHandleZeroOrMinusOneIsInvalid()
: base((IntPtr)(-1))
{
}
/// <summary>Gets a value that indicates whether the handle is invalid.</summary>
/// <returns>true if the handle is not valid; otherwise, false.</returns>
// Token: 0x170000CE RID: 206
// (get) Token: 0x060006E7 RID: 1767 RVA: 0x00015454 File Offset: 0x00013654
public override bool IsInvalid
{
get
{
return this.handle == (IntPtr)(-1) || this.handle == IntPtr.Zero;
}
}
}
}
@@ -0,0 +1,34 @@
using System;
using System.IO;
namespace Microsoft.Win32.SafeHandles
{
/// <summary>Represents a wrapper class for a file handle. </summary>
// Token: 0x0200006E RID: 110
public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid
{
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Win32.SafeHandles.SafeFileHandle" /> class. </summary>
/// <param name="preexistingHandle">An <see cref="T:System.IntPtr" /> object that represents the pre-existing handle to use.</param>
/// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).</param>
// Token: 0x060006E8 RID: 1768 RVA: 0x00015480 File Offset: 0x00013680
public SafeFileHandle(IntPtr preexistingHandle, bool ownsHandle)
: base(ownsHandle)
{
base.SetHandle(preexistingHandle);
}
// Token: 0x060006E9 RID: 1769 RVA: 0x00015490 File Offset: 0x00013690
internal SafeFileHandle()
: base(true)
{
}
// Token: 0x060006EA RID: 1770 RVA: 0x0001549C File Offset: 0x0001369C
protected override bool ReleaseHandle()
{
MonoIOError monoIOError;
MonoIO.Close(this.handle, out monoIOError);
return monoIOError == MonoIOError.ERROR_SUCCESS;
}
}
}
@@ -0,0 +1,32 @@
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace Microsoft.Win32.SafeHandles
{
/// <summary>Provides a base class for Win32 safe handle implementations in which the value of -1 indicates an invalid handle.</summary>
// Token: 0x0200006F RID: 111
public abstract class SafeHandleMinusOneIsInvalid : SafeHandle, IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Win32.SafeHandles.SafeHandleMinusOneIsInvalid" /> class, specifying whether the handle is to be reliably released. </summary>
/// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).</param>
// Token: 0x060006EB RID: 1771 RVA: 0x000154BC File Offset: 0x000136BC
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected SafeHandleMinusOneIsInvalid(bool ownsHandle)
: base((IntPtr)0, ownsHandle)
{
}
/// <summary>Gets a value that indicates whether the handle is invalid.</summary>
/// <returns>true if the handle is not valid; otherwise, false.</returns>
// Token: 0x170000CF RID: 207
// (get) Token: 0x060006EC RID: 1772 RVA: 0x000154CC File Offset: 0x000136CC
public override bool IsInvalid
{
get
{
return this.handle == (IntPtr)(-1);
}
}
}
}
@@ -0,0 +1,32 @@
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace Microsoft.Win32.SafeHandles
{
/// <summary>Provides a base class for Win32 safe handle implementations in which the value of either 0 or -1 indicates an invalid handle.</summary>
// Token: 0x02000070 RID: 112
public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle, IDisposable
{
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid" /> class, specifying whether the handle is to be reliably released. </summary>
/// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).</param>
// Token: 0x060006ED RID: 1773 RVA: 0x000154E0 File Offset: 0x000136E0
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle)
: base((IntPtr)0, ownsHandle)
{
}
/// <summary>Gets a value that indicates whether the handle is invalid.</summary>
/// <returns>true if the handle is not valid; otherwise, false.</returns>
// Token: 0x170000D0 RID: 208
// (get) Token: 0x060006EE RID: 1774 RVA: 0x000154F0 File Offset: 0x000136F0
public override bool IsInvalid
{
get
{
return this.handle == (IntPtr)(-1) || this.handle == (IntPtr)0;
}
}
}
}
@@ -0,0 +1,29 @@
using System;
using System.Runtime.ConstrainedExecution;
using System.Threading;
namespace Microsoft.Win32.SafeHandles
{
/// <summary>Represents a wrapper class for a wait handle. </summary>
// Token: 0x02000071 RID: 113
public sealed class SafeWaitHandle : SafeHandleZeroOrMinusOneIsInvalid
{
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Win32.SafeHandles.SafeWaitHandle" /> class. </summary>
/// <param name="existingHandle">An <see cref="T:System.IntPtr" /> object that represents the pre-existing handle to use.</param>
/// <param name="ownsHandle">true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).</param>
// Token: 0x060006EF RID: 1775 RVA: 0x00015528 File Offset: 0x00013728
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public SafeWaitHandle(IntPtr existingHandle, bool ownsHandle)
: base(ownsHandle)
{
base.SetHandle(existingHandle);
}
// Token: 0x060006F0 RID: 1776 RVA: 0x00015538 File Offset: 0x00013738
protected override bool ReleaseHandle()
{
NativeEventCalls.CloseEvent_internal(this.handle);
return true;
}
}
}