using System; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; namespace Microsoft.Win32.SafeHandles { /// Provides a base class for Win32 safe handle implementations in which the value of either 0 or -1 indicates an invalid handle. // Token: 0x02000070 RID: 112 public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle, IDisposable { /// Initializes a new instance of the class, specifying whether the handle is to be reliably released. /// true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). // Token: 0x060006ED RID: 1773 RVA: 0x000154E0 File Offset: 0x000136E0 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base((IntPtr)0, ownsHandle) { } /// Gets a value that indicates whether the handle is invalid. /// true if the handle is not valid; otherwise, false. // 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; } } } }