Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Win32 / SafeHandles / SafeMemoryMappedFileHandle.cs / 1305376 / SafeMemoryMappedFileHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedFileHandle ** ** Purpose: Safe handle wrapping a file mapping object handle ** ** Date: Febuary 7, 2007 ** ===========================================================*/ using System; 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 SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return UnsafeNativeMethods.CloseHandle(handle); } } } // 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
- RoutedEvent.cs
- JsonDataContract.cs
- ListControlBuilder.cs
- NavigateEvent.cs
- ApplicationSecurityManager.cs
- XPathMultyIterator.cs
- _LoggingObject.cs
- EnglishPluralizationService.cs
- MethodBuilderInstantiation.cs
- Simplifier.cs
- QuadraticBezierSegment.cs
- DataViewManagerListItemTypeDescriptor.cs
- DrawingBrush.cs
- UserControl.cs
- DataGridTableCollection.cs
- BaseComponentEditor.cs
- State.cs
- ToolStripSystemRenderer.cs
- SQLConvert.cs
- PropertyGridEditorPart.cs
- IFlowDocumentViewer.cs
- TransformationRules.cs
- FrameworkElementFactoryMarkupObject.cs
- WpfKnownTypeInvoker.cs
- XmlSchemaInfo.cs
- AppDomainAttributes.cs
- Pen.cs
- GridViewActionList.cs
- DataGridAddNewRow.cs
- TextBreakpoint.cs
- QuadraticBezierSegment.cs
- CodeSnippetTypeMember.cs
- HttpClientChannel.cs
- BevelBitmapEffect.cs
- ISAPIApplicationHost.cs
- NgenServicingAttributes.cs
- XamlVector3DCollectionSerializer.cs
- ValueUnavailableException.cs
- NegationPusher.cs
- HatchBrush.cs
- FormsAuthenticationEventArgs.cs
- OdbcHandle.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- DataGridColumn.cs
- SqlTypesSchemaImporter.cs
- _AutoWebProxyScriptHelper.cs
- LinqToSqlWrapper.cs
- ReadOnlyCollectionBuilder.cs
- CacheMemory.cs
- StorageFunctionMapping.cs
- DiscoveryDocumentLinksPattern.cs
- WebPartConnectVerb.cs
- LinkConverter.cs
- ImportedNamespaceContextItem.cs
- ReadOnlyTernaryTree.cs
- FacetValueContainer.cs
- View.cs
- XappLauncher.cs
- IntranetCredentialPolicy.cs
- UInt64Converter.cs
- XmlNamespaceMappingCollection.cs
- Int32Collection.cs
- CellParaClient.cs
- storagemappingitemcollection.viewdictionary.cs
- LinqDataSourceHelper.cs
- DetailsViewDeleteEventArgs.cs
- AbstractDataSvcMapFileLoader.cs
- PolicyManager.cs
- BufferedStream.cs
- GlobalizationSection.cs
- ExpressionHelper.cs
- StringAnimationUsingKeyFrames.cs
- DispatcherEventArgs.cs
- MetadataItemCollectionFactory.cs
- DBSqlParserTableCollection.cs
- sqlcontext.cs
- SqlBuffer.cs
- ConfigurationValidatorAttribute.cs
- ScaleTransform3D.cs
- NegationPusher.cs
- URI.cs
- InProcStateClientManager.cs
- SmtpNegotiateAuthenticationModule.cs
- FixedSOMFixedBlock.cs
- FormatterServices.cs
- ListViewAutomationPeer.cs
- DataDocumentXPathNavigator.cs
- ObjectHandle.cs
- DataServiceResponse.cs
- PersonalizationStateQuery.cs
- Base64Decoder.cs
- Point.cs
- Internal.cs
- ValidatorCollection.cs
- SystemColorTracker.cs
- OleAutBinder.cs
- SamlSecurityToken.cs
- BasePropertyDescriptor.cs
- ColumnMapTranslator.cs
- InternalBase.cs