Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeFileMappingHandle.cs / 1 / SafeFileMappingHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeViewOfFileHandle ** ** ** A wrapper for file handles ** ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle() : base(true) {} // 0 is an Invalid Handle [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return Win32Native.CloseHandle(handle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataChangedEventManager.cs
- MemberCollection.cs
- NameNode.cs
- StreamReader.cs
- LinkConverter.cs
- wgx_sdk_version.cs
- MissingMethodException.cs
- ProgressChangedEventArgs.cs
- WebBrowserNavigatingEventHandler.cs
- ProcessHostConfigUtils.cs
- LinqDataSourceView.cs
- Delegate.cs
- FixedFlowMap.cs
- OracleInternalConnection.cs
- ZipIOExtraField.cs
- SignatureHelper.cs
- ProfilePropertyNameValidator.cs
- OdbcConnection.cs
- AttachedPropertyBrowsableAttribute.cs
- FrameworkPropertyMetadata.cs
- SerializationHelper.cs
- CatalogZone.cs
- DataGridViewCellStyleConverter.cs
- SafeLocalAllocation.cs
- UnionCqlBlock.cs
- MarkupObject.cs
- RtfToXamlLexer.cs
- LayoutTable.cs
- DataGridTableStyleMappingNameEditor.cs
- EntityClientCacheEntry.cs
- TimeSpanMinutesConverter.cs
- SponsorHelper.cs
- LeaseManager.cs
- BufferModesCollection.cs
- RegularExpressionValidator.cs
- NotImplementedException.cs
- MemberBinding.cs
- DrawingBrush.cs
- EmptyCollection.cs
- CachedFontFace.cs
- XmlSerializerNamespaces.cs
- IsolatedStorage.cs
- Action.cs
- GeometryHitTestParameters.cs
- XmlWriterSettings.cs
- SessionSwitchEventArgs.cs
- IncrementalReadDecoders.cs
- EmptyStringExpandableObjectConverter.cs
- ObjectDataSourceMethodEventArgs.cs
- MostlySingletonList.cs
- ArrayConverter.cs
- MDIClient.cs
- MasterPageCodeDomTreeGenerator.cs
- UnsafeNativeMethods.cs
- ThumbAutomationPeer.cs
- ParallelEnumerable.cs
- securitycriticaldataClass.cs
- TextStore.cs
- _TransmitFileOverlappedAsyncResult.cs
- mediaeventshelper.cs
- CharStorage.cs
- RSACryptoServiceProvider.cs
- ContainerParagraph.cs
- AppDomainGrammarProxy.cs
- XPathNode.cs
- MouseActionValueSerializer.cs
- RuntimeArgumentHandle.cs
- PropertyBuilder.cs
- _ChunkParse.cs
- XmlTextEncoder.cs
- VBCodeProvider.cs
- FontNamesConverter.cs
- ListChangedEventArgs.cs
- LayoutEditorPart.cs
- ToolboxItemCollection.cs
- DoubleAnimationClockResource.cs
- AttributeProviderAttribute.cs
- File.cs
- RenderingEventArgs.cs
- ClientOperation.cs
- XPathConvert.cs
- ApplicationCommands.cs
- Brush.cs
- ACL.cs
- PageThemeCodeDomTreeGenerator.cs
- FontFamilyConverter.cs
- WebPartZoneBase.cs
- ComPersistableTypeElementCollection.cs
- bindurihelper.cs
- CollectionViewProxy.cs
- ScriptRegistrationManager.cs
- CodeTypeDeclaration.cs
- Hash.cs
- Freezable.cs
- OperatingSystem.cs
- MailWriter.cs
- ServiceEndpointElementCollection.cs
- DataServiceExpressionVisitor.cs
- UnsafeNativeMethods.cs
- SafeBitVector32.cs