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
- MetaTableHelper.cs
- SizeF.cs
- ItemChangedEventArgs.cs
- FormViewRow.cs
- GeometryModel3D.cs
- HttpConfigurationSystem.cs
- WebBrowser.cs
- IpcServerChannel.cs
- FactoryMaker.cs
- Serializer.cs
- EventRoute.cs
- CommandManager.cs
- CompositeKey.cs
- DbgCompiler.cs
- ScriptingWebServicesSectionGroup.cs
- InstanceKeyNotReadyException.cs
- DragDrop.cs
- ExceptionHandlerDesigner.cs
- AndMessageFilterTable.cs
- DataSetUtil.cs
- NotEqual.cs
- SelectionChangedEventArgs.cs
- EntityContainerEmitter.cs
- Int32Collection.cs
- ImageListImage.cs
- UriScheme.cs
- CanonicalXml.cs
- Splitter.cs
- InstanceDataCollectionCollection.cs
- X509IssuerSerialKeyIdentifierClause.cs
- DSACryptoServiceProvider.cs
- CannotUnloadAppDomainException.cs
- XmlEncoding.cs
- LocatorManager.cs
- ThemeDictionaryExtension.cs
- PropagatorResult.cs
- ImageSourceConverter.cs
- StylusPlugin.cs
- TdsRecordBufferSetter.cs
- MsmqNonTransactedPoisonHandler.cs
- ConnectorEditor.cs
- QilExpression.cs
- ImageFormat.cs
- EventLogException.cs
- SessionPageStateSection.cs
- ThreadStaticAttribute.cs
- CounterCreationData.cs
- XmlSchemaSimpleContentRestriction.cs
- SapiRecoInterop.cs
- CountAggregationOperator.cs
- AdditionalEntityFunctions.cs
- XmlSiteMapProvider.cs
- Type.cs
- CanonicalFontFamilyReference.cs
- DataBoundLiteralControl.cs
- PropertyTabAttribute.cs
- Panel.cs
- Deflater.cs
- RepeaterDesigner.cs
- CommentAction.cs
- WebScriptServiceHostFactory.cs
- BitVector32.cs
- CodeGotoStatement.cs
- SoapSchemaMember.cs
- HttpHandlersSection.cs
- UriExt.cs
- UIElement3D.cs
- XmlNode.cs
- ApplicationServicesHostFactory.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- WindowsAltTab.cs
- WsiProfilesElement.cs
- HyperLinkStyle.cs
- ParameterElementCollection.cs
- BaseAsyncResult.cs
- ValueHandle.cs
- MultiPropertyDescriptorGridEntry.cs
- AutomationTextAttribute.cs
- ConversionValidationRule.cs
- TimeEnumHelper.cs
- Semaphore.cs
- SqlCharStream.cs
- RuntimeCompatibilityAttribute.cs
- FakeModelPropertyImpl.cs
- GraphicsState.cs
- BamlBinaryReader.cs
- TransformGroup.cs
- DES.cs
- SelectorAutomationPeer.cs
- DeferredSelectedIndexReference.cs
- ScriptResourceInfo.cs
- HttpCapabilitiesSectionHandler.cs
- Tag.cs
- Message.cs
- SourceFileBuildProvider.cs
- OdbcConnection.cs
- DefaultDiscoveryService.cs
- ColumnTypeConverter.cs
- CharEnumerator.cs
- Formatter.cs