Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Win32 / SafeHandles / SafeMemoryMappedViewHandle.cs / 1305376 / SafeMemoryMappedViewHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedViewHandle ** ** Purpose: Safe handle wrapping a MMF view pointer ** ** Date: February 7, 2007 ** ===========================================================*/ using System; using System.Runtime.InteropServices; 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 SafeMemoryMappedViewHandle : SafeBuffer { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedViewHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedViewHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { base.SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { if (UnsafeNativeMethods.UnmapViewOfFile(handle)) { handle = IntPtr.Zero; return true; } return false; } } } // 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
- TextBoxAutomationPeer.cs
- EventTask.cs
- HandlerMappingMemo.cs
- AuthenticationModuleElementCollection.cs
- TimeManager.cs
- XamlDesignerSerializationManager.cs
- sqlstateclientmanager.cs
- StorageAssociationSetMapping.cs
- BaseResourcesBuildProvider.cs
- RestHandlerFactory.cs
- ScriptReference.cs
- NameTable.cs
- AssertFilter.cs
- ParserOptions.cs
- ConstNode.cs
- ApplicationSettingsBase.cs
- QuotedStringFormatReader.cs
- SocketInformation.cs
- DynamicValueConverter.cs
- XmlTextReaderImpl.cs
- TypeSystemProvider.cs
- EDesignUtil.cs
- MaskedTextBox.cs
- TypeDescriptorFilterService.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ServiceSecurityAuditBehavior.cs
- NameSpaceEvent.cs
- StringValueConverter.cs
- Environment.cs
- MetadataElement.cs
- XmlSchemaObjectCollection.cs
- WebPartMinimizeVerb.cs
- EditingCoordinator.cs
- NegatedCellConstant.cs
- XmlException.cs
- SafeReadContext.cs
- ClientSponsor.cs
- UpdateCompiler.cs
- MemberCollection.cs
- RsaKeyIdentifierClause.cs
- SqlDelegatedTransaction.cs
- AspCompat.cs
- MultiSelector.cs
- DropDownList.cs
- xmlglyphRunInfo.cs
- CommonDialog.cs
- XamlVector3DCollectionSerializer.cs
- WsatServiceAddress.cs
- RuleInfoComparer.cs
- BinHexDecoder.cs
- IteratorFilter.cs
- HttpListenerContext.cs
- OdbcConnectionFactory.cs
- PolyQuadraticBezierSegment.cs
- TextSerializer.cs
- TransactionsSectionGroup.cs
- ObjectParameterCollection.cs
- Parser.cs
- RuleAttributes.cs
- HtmlControlPersistable.cs
- EllipseGeometry.cs
- ButtonBase.cs
- CodePageEncoding.cs
- LabelEditEvent.cs
- Parsers.cs
- BindUriHelper.cs
- GroupStyle.cs
- GlyphTypeface.cs
- _CacheStreams.cs
- LocatorBase.cs
- newinstructionaction.cs
- BaseDataListComponentEditor.cs
- SHA512Cng.cs
- SrgsRuleRef.cs
- ClientCredentialsElement.cs
- TargetInvocationException.cs
- ScriptComponentDescriptor.cs
- XmlSchemaAny.cs
- DirectoryNotFoundException.cs
- datacache.cs
- Duration.cs
- BasicViewGenerator.cs
- QilFactory.cs
- ObjectItemCollection.cs
- NativeMethods.cs
- UTF7Encoding.cs
- CustomTypeDescriptor.cs
- UndoManager.cs
- BindingMemberInfo.cs
- CodeMemberEvent.cs
- TextureBrush.cs
- WCFServiceClientProxyGenerator.cs
- ComponentDispatcherThread.cs
- GZipUtils.cs
- FileLevelControlBuilderAttribute.cs
- PackageRelationshipCollection.cs
- BindingSource.cs
- StubHelpers.cs
- ControlBuilder.cs
- Opcode.cs