32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|