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 -1 indicates an invalid handle.
// Token: 0x0200006C RID: 108
public abstract class CriticalHandleMinusOneIsInvalid : CriticalHandle, IDisposable
{
/// Initializes a new instance of the class.
// Token: 0x060006E4 RID: 1764 RVA: 0x00015420 File Offset: 0x00013620
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected CriticalHandleMinusOneIsInvalid()
: base((IntPtr)(-1))
{
}
/// Gets a value that indicates whether the handle is invalid.
/// true if the handle is not valid; otherwise, false.
// Token: 0x170000CD RID: 205
// (get) Token: 0x060006E5 RID: 1765 RVA: 0x00015430 File Offset: 0x00013630
public override bool IsInvalid
{
get
{
return this.handle == (IntPtr)(-1);
}
}
}
}