using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace Microsoft.Win32.SafeHandles
{
/// Provides a base class for Win32 critical handle implementations in which the value of either 0 or -1 indicates an invalid handle.
// Token: 0x0200006D RID: 109
public abstract class CriticalHandleZeroOrMinusOneIsInvalid : CriticalHandle, IDisposable
{
/// Initializes a new instance of the class.
// Token: 0x060006E6 RID: 1766 RVA: 0x00015444 File Offset: 0x00013644
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected CriticalHandleZeroOrMinusOneIsInvalid()
: base((IntPtr)(-1))
{
}
/// Gets a value that indicates whether the handle is invalid.
/// true if the handle is not valid; otherwise, false.
// 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;
}
}
}
}