Modify Jenkins scripts to enable babysitter script on Cygwin
[mono.git] / mcs / class / referencesource / mscorlib / microsoft / win32 / safehandles / safepefilehandle.cs
1 // ==++==
2 // 
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6
7 using System;
8 using System.Reflection;
9 using System.Runtime.CompilerServices;
10 using System.Runtime.ConstrainedExecution;
11 using System.Runtime.InteropServices;
12 using System.Security;
13
14 namespace Microsoft.Win32.SafeHandles
15 {
16     /// <summary>
17     ///     Handle to a VM PEFile *
18     /// </summary>
19     [SecurityCritical] 
20     internal sealed class SafePEFileHandle : SafeHandleZeroOrMinusOneIsInvalid
21     {
22         private SafePEFileHandle() : base(true)
23         {
24         }
25
26         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
27         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
28         [SuppressUnmanagedCodeSecurity]
29         private static extern void ReleaseSafePEFileHandle(IntPtr peFile);
30
31         [SecurityCritical]
32         protected override bool ReleaseHandle()
33         {
34             ReleaseSafePEFileHandle(handle);
35             return true;
36         }
37     }
38 }