Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Win32 / SafeHandles / SafeMemoryMappedFileHandle.cs / 1305376 / SafeMemoryMappedFileHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedFileHandle ** ** Purpose: Safe handle wrapping a file mapping object handle ** ** Date: Febuary 7, 2007 ** ===========================================================*/ using System; using System.Runtime.Versioning; using System.Security.Permissions; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { // Reliability notes: // ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle. // It gets prepared as a CER at instance construction time. This safe handle doesn't // need to override IsInvalid because the one it inherits from // SafeHandleZeroOrMinusOneIsInvalid is correct. //// #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 public sealed class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return UnsafeNativeMethods.CloseHandle(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedFileHandle ** ** Purpose: Safe handle wrapping a file mapping object handle ** ** Date: Febuary 7, 2007 ** ===========================================================*/ using System; using System.Runtime.Versioning; using System.Security.Permissions; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { // Reliability notes: // ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle. // It gets prepared as a CER at instance construction time. This safe handle doesn't // need to override IsInvalid because the one it inherits from // SafeHandleZeroOrMinusOneIsInvalid is correct. //// // #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 public sealed class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return UnsafeNativeMethods.CloseHandle(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.//
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NullableIntAverageAggregationOperator.cs
- ListBox.cs
- TextSelectionHelper.cs
- LinkConverter.cs
- ScalarConstant.cs
- Pkcs7Recipient.cs
- SQLByte.cs
- Publisher.cs
- SerializationAttributes.cs
- PrePrepareMethodAttribute.cs
- NullableFloatAverageAggregationOperator.cs
- NameValuePair.cs
- NumberSubstitution.cs
- UndirectedGraph.cs
- HMACSHA1.cs
- DigitalSignatureProvider.cs
- PropertyChangedEventManager.cs
- ZipArchive.cs
- SecurityChannelFactory.cs
- XmlText.cs
- XmlConvert.cs
- XmlTextEncoder.cs
- FormatterServicesNoSerializableCheck.cs
- CookieProtection.cs
- StorageComplexTypeMapping.cs
- ValidationEventArgs.cs
- CodeDesigner.cs
- Rect3D.cs
- PassportIdentity.cs
- Rotation3DAnimationBase.cs
- COM2IDispatchConverter.cs
- VariantWrapper.cs
- ThrowOnMultipleAssignment.cs
- DriveInfo.cs
- IteratorFilter.cs
- Span.cs
- ParameterEditorUserControl.cs
- SQLSingle.cs
- WbmpConverter.cs
- Stroke2.cs
- PropertyDescriptorGridEntry.cs
- TreeNodeBinding.cs
- BitmapEffectOutputConnector.cs
- BindingCompleteEventArgs.cs
- StyleSheetComponentEditor.cs
- VersionConverter.cs
- GZipStream.cs
- UnsafeNativeMethodsMilCoreApi.cs
- XPathAncestorQuery.cs
- DetailsViewDesigner.cs
- BasicCellRelation.cs
- ObjectStateEntry.cs
- SymbolUsageManager.cs
- TimeZone.cs
- ManagedCodeMarkers.cs
- InvalidEnumArgumentException.cs
- PropertyDescriptor.cs
- FontUnitConverter.cs
- ItemType.cs
- Debug.cs
- IssuanceLicense.cs
- OpCodes.cs
- ConfigXmlText.cs
- SqlStatistics.cs
- CompilerGeneratedAttribute.cs
- MissingMethodException.cs
- ParameterElement.cs
- DbgUtil.cs
- RefExpr.cs
- QueueProcessor.cs
- OdbcPermission.cs
- KeyValuePair.cs
- XmlHierarchyData.cs
- __FastResourceComparer.cs
- WebBrowserNavigatingEventHandler.cs
- Attributes.cs
- SiteMapPath.cs
- ToolStripContentPanelRenderEventArgs.cs
- ObjectMemberMapping.cs
- AnnotationResourceChangedEventArgs.cs
- CodeSubDirectoriesCollection.cs
- AutoGeneratedField.cs
- ReflectPropertyDescriptor.cs
- BrowserDefinitionCollection.cs
- SymbolDocumentGenerator.cs
- Divide.cs
- ComponentCodeDomSerializer.cs
- unitconverter.cs
- SystemWebCachingSectionGroup.cs
- DoubleAnimationBase.cs
- Rotation3D.cs
- SubpageParaClient.cs
- XsltInput.cs
- DataBinder.cs
- WebPartManagerInternals.cs
- SqlMultiplexer.cs
- DeferredTextReference.cs
- Translator.cs
- ResourceExpressionBuilder.cs
- X509Utils.cs