using System;
using System.IO;
namespace Microsoft.Win32.SafeHandles
{
/// Represents a wrapper class for a file handle.
// Token: 0x0200006E RID: 110
public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid
{
/// Initializes a new instance of the class.
/// An object that represents the pre-existing handle to use.
/// true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).
// Token: 0x060006E8 RID: 1768 RVA: 0x00015480 File Offset: 0x00013680
public SafeFileHandle(IntPtr preexistingHandle, bool ownsHandle)
: base(ownsHandle)
{
base.SetHandle(preexistingHandle);
}
// Token: 0x060006E9 RID: 1769 RVA: 0x00015490 File Offset: 0x00013690
internal SafeFileHandle()
: base(true)
{
}
// Token: 0x060006EA RID: 1770 RVA: 0x0001549C File Offset: 0x0001369C
protected override bool ReleaseHandle()
{
MonoIOError monoIOError;
MonoIO.Close(this.handle, out monoIOError);
return monoIOError == MonoIOError.ERROR_SUCCESS;
}
}
}