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
- AttributeCallbackBuilder.cs
- BoolExpr.cs
- UpdateProgress.cs
- DataGridViewIntLinkedList.cs
- UserControlParser.cs
- ConfigXmlWhitespace.cs
- QueueSurrogate.cs
- ObjectStorage.cs
- PenCursorManager.cs
- SecurityKeyUsage.cs
- LineMetrics.cs
- ImageIndexEditor.cs
- PointKeyFrameCollection.cs
- BitmapCacheBrush.cs
- Resources.Designer.cs
- Logging.cs
- HttpInputStream.cs
- GetPageNumberCompletedEventArgs.cs
- TableItemPattern.cs
- precedingquery.cs
- DbConnectionOptions.cs
- PrimarySelectionAdorner.cs
- TableSectionStyle.cs
- UmAlQuraCalendar.cs
- RuntimeIdentifierPropertyAttribute.cs
- XmlSerializer.cs
- VirtualDirectoryMapping.cs
- ConfigXmlComment.cs
- CompatibleComparer.cs
- XmlTextWriter.cs
- FontFamilyIdentifier.cs
- XmlSignatureManifest.cs
- BuildManager.cs
- ReadOnlyCollectionBase.cs
- DataSourceHelper.cs
- InputReport.cs
- OperationContextScope.cs
- ExpandoClass.cs
- MetadataSection.cs
- ACE.cs
- SynchronizedInputHelper.cs
- EventSetter.cs
- CellParaClient.cs
- HttpEncoder.cs
- StringAttributeCollection.cs
- XmlChoiceIdentifierAttribute.cs
- DataSetFieldSchema.cs
- TextEditorLists.cs
- ListViewEditEventArgs.cs
- baseaxisquery.cs
- TypeUnloadedException.cs
- XmlParserContext.cs
- AuthenticationModuleElementCollection.cs
- SqlNodeAnnotation.cs
- Light.cs
- SiteMapNode.cs
- complextypematerializer.cs
- StringConverter.cs
- ControlDesignerState.cs
- WindowsScroll.cs
- UICuesEvent.cs
- WindowsTooltip.cs
- BindingCompleteEventArgs.cs
- FrameworkElement.cs
- FileSystemEnumerable.cs
- SecurityValidationBehavior.cs
- WebProxyScriptElement.cs
- MethodCallTranslator.cs
- ImageDrawing.cs
- FunctionParameter.cs
- EdmFunction.cs
- XmlSchemaGroupRef.cs
- HttpHandlersSection.cs
- BindingWorker.cs
- ObjectViewQueryResultData.cs
- Label.cs
- DebugTracing.cs
- RightsManagementInformation.cs
- XmlIncludeAttribute.cs
- TraceData.cs
- ResXFileRef.cs
- SystemDiagnosticsSection.cs
- HtmlUtf8RawTextWriter.cs
- XamlPoint3DCollectionSerializer.cs
- OleDbEnumerator.cs
- XmlBinaryReader.cs
- EventListener.cs
- DataGridViewCellStyleChangedEventArgs.cs
- AutomationPatternInfo.cs
- WebScriptClientGenerator.cs
- _RequestCacheProtocol.cs
- AddingNewEventArgs.cs
- WmpBitmapEncoder.cs
- HierarchicalDataBoundControl.cs
- PrivilegeNotHeldException.cs
- HyperLinkDataBindingHandler.cs
- NotificationContext.cs
- CellTreeNodeVisitors.cs
- EntityDataSourceDataSelectionPanel.cs
- UnsafeNativeMethodsCLR.cs