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
- GeometryHitTestResult.cs
- SmtpDigestAuthenticationModule.cs
- TextBoxAutomationPeer.cs
- SettingsPropertyValueCollection.cs
- ToolStripSeparator.cs
- HttpRequest.cs
- ETagAttribute.cs
- PersonalizationDictionary.cs
- OledbConnectionStringbuilder.cs
- DataGridColumn.cs
- KeyInterop.cs
- OdbcEnvironmentHandle.cs
- DiscoveryClientOutputChannel.cs
- SettingsPropertyCollection.cs
- OleDbInfoMessageEvent.cs
- ObjectDataSourceEventArgs.cs
- HijriCalendar.cs
- Cursors.cs
- KeySpline.cs
- ParseChildrenAsPropertiesAttribute.cs
- GetMemberBinder.cs
- TypedReference.cs
- GridViewRow.cs
- QilGeneratorEnv.cs
- _BufferOffsetSize.cs
- XPathDocument.cs
- KeyPressEvent.cs
- SiblingIterators.cs
- ImpersonateTokenRef.cs
- XmlLanguageConverter.cs
- GridViewSortEventArgs.cs
- XmlSchemaAttribute.cs
- XmlAttributeCollection.cs
- WorkflowMarkupSerializationProvider.cs
- UrlMappingsSection.cs
- XmlFormatExtensionPrefixAttribute.cs
- FileChangesMonitor.cs
- Rotation3D.cs
- CodeNamespaceCollection.cs
- Calendar.cs
- RawStylusInputCustomDataList.cs
- TableCellCollection.cs
- DropDownList.cs
- WCFModelStrings.Designer.cs
- ReachIDocumentPaginatorSerializer.cs
- DependencyPropertyConverter.cs
- Int16Converter.cs
- ExceptionRoutedEventArgs.cs
- TraceContextRecord.cs
- QueryPageSettingsEventArgs.cs
- UInt64Converter.cs
- FieldInfo.cs
- PerformanceCounterLib.cs
- CodeEventReferenceExpression.cs
- FlagPanel.cs
- COM2TypeInfoProcessor.cs
- ComboBoxRenderer.cs
- DataSourceNameHandler.cs
- Compilation.cs
- ErrorWebPart.cs
- DataAdapter.cs
- TypeUtil.cs
- ContractInstanceProvider.cs
- Point3DConverter.cs
- DrawingState.cs
- TerminateWorkflow.cs
- MatrixCamera.cs
- Filter.cs
- QueryRewriter.cs
- ShapeTypeface.cs
- SourceElementsCollection.cs
- DefaultAsyncDataDispatcher.cs
- FileChangesMonitor.cs
- XmlQueryContext.cs
- UIElementParaClient.cs
- StructuredTypeInfo.cs
- Sequence.cs
- WebServiceResponse.cs
- SingleResultAttribute.cs
- SuppressMessageAttribute.cs
- RSACryptoServiceProvider.cs
- KoreanCalendar.cs
- StringAnimationBase.cs
- BinaryKeyIdentifierClause.cs
- DeclarationUpdate.cs
- EventHandlerService.cs
- TextOptionsInternal.cs
- HwndAppCommandInputProvider.cs
- ComPlusThreadInitializer.cs
- PublisherIdentityPermission.cs
- HttpCacheVaryByContentEncodings.cs
- HtmlControlPersistable.cs
- Bezier.cs
- WorkflowDesignerMessageFilter.cs
- AnnotationMap.cs
- DataBindingCollectionEditor.cs
- BrowserCapabilitiesFactoryBase.cs
- Int64AnimationBase.cs
- WorkflowPrinting.cs
- DesignerValidatorAdapter.cs