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
- DoubleStorage.cs
- SqlDelegatedTransaction.cs
- RSAProtectedConfigurationProvider.cs
- XmlWrappingWriter.cs
- RelatedCurrencyManager.cs
- FileEnumerator.cs
- XmlRootAttribute.cs
- httpserverutility.cs
- BlockingCollection.cs
- UpnEndpointIdentity.cs
- LogicalChannelCollection.cs
- SynchronizedInputHelper.cs
- FontWeight.cs
- Message.cs
- EncryptedPackage.cs
- Inline.cs
- WebPartConnectionsCloseVerb.cs
- RunClient.cs
- OleDbPermission.cs
- Annotation.cs
- XmlName.cs
- HtmlInputButton.cs
- VisualStyleInformation.cs
- StringDictionaryWithComparer.cs
- PermissionSet.cs
- Select.cs
- XmlSchemaAll.cs
- RowCache.cs
- WindowsListViewSubItem.cs
- EUCJPEncoding.cs
- InvalidOperationException.cs
- ToolStripRendererSwitcher.cs
- EntityDataSourceWizardForm.cs
- SimpleWorkerRequest.cs
- HGlobalSafeHandle.cs
- CapabilitiesRule.cs
- XmlSchemaElement.cs
- CalculatedColumn.cs
- ToolStripRenderer.cs
- Matrix.cs
- Table.cs
- SafeFileHandle.cs
- PathFigure.cs
- SectionInput.cs
- InternalConfigHost.cs
- Model3DGroup.cs
- ExceptionHelpers.cs
- XmlSchemaParticle.cs
- FlagsAttribute.cs
- Parser.cs
- StrokeFIndices.cs
- CacheOutputQuery.cs
- TableParaClient.cs
- ByteFacetDescriptionElement.cs
- SafeEventLogWriteHandle.cs
- DbUpdateCommandTree.cs
- FtpRequestCacheValidator.cs
- BeginSelectCardRequest.cs
- BitmapVisualManager.cs
- SingletonConnectionReader.cs
- Int32Rect.cs
- PackagePartCollection.cs
- PropertyReferenceSerializer.cs
- DataGridViewCellPaintingEventArgs.cs
- GetPageCompletedEventArgs.cs
- ConnectionStringSettingsCollection.cs
- MappingModelBuildProvider.cs
- XmlWriter.cs
- wgx_exports.cs
- DataListItemCollection.cs
- PriorityQueue.cs
- ChannelSinkStacks.cs
- CachedRequestParams.cs
- FileStream.cs
- BuildProvider.cs
- AnimationException.cs
- ForeignConstraint.cs
- Int32Rect.cs
- ImagingCache.cs
- TypedCompletedAsyncResult.cs
- MemberBinding.cs
- DbModificationClause.cs
- Sql8ExpressionRewriter.cs
- Int64AnimationUsingKeyFrames.cs
- TreeNodeBindingCollection.cs
- ProcessModuleCollection.cs
- XmlBufferedByteStreamReader.cs
- VirtualPathProvider.cs
- StringBuilder.cs
- QuaternionValueSerializer.cs
- AttachedProperty.cs
- PropertyDescriptorGridEntry.cs
- ParserExtension.cs
- SQLUtility.cs
- CompositeClientFormatter.cs
- EdmMember.cs
- BindingManagerDataErrorEventArgs.cs
- Sql8ExpressionRewriter.cs
- ProtectedUri.cs
- HttpStreamXmlDictionaryWriter.cs