33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|