Modify Jenkins scripts to enable babysitter script on Cygwin
[mono.git] / mcs / class / referencesource / mscorlib / microsoft / win32 / safehandles / safefilemappinghandle.cs
1 // ==++==
2 // 
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6 /*============================================================
7 **
8 ** Class:  SafeFileMappingHandle
9 **
10 **
11 ** A wrapper for file handles
12 **
13 ** 
14 ===========================================================*/
15 using System;
16 using System.Security;
17 using System.Security.Permissions;
18 using System.Runtime.InteropServices;
19 using System.Runtime.CompilerServices;
20 using System.Runtime.ConstrainedExecution;
21 using System.Runtime.Versioning;
22
23 namespace Microsoft.Win32.SafeHandles
24 {
25     [System.Security.SecurityCritical]  // auto-generated
26     internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid
27     {
28         [System.Security.SecurityCritical]  // auto-generated_required
29         internal SafeFileMappingHandle() : base(true) {}
30
31         // 0 is an Invalid Handle
32         [System.Security.SecurityCritical]  // auto-generated_required
33         internal SafeFileMappingHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle)
34         {
35             SetHandle(handle);
36         }
37
38         [System.Security.SecurityCritical]
39         [ResourceExposure(ResourceScope.Machine)]
40         [ResourceConsumption(ResourceScope.Machine)]
41         override protected bool ReleaseHandle()
42         {
43             return Win32Native.CloseHandle(handle);
44         }
45     }
46 }
47