Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- PaginationProgressEventArgs.cs
- XmlSchemaSimpleContent.cs
- ConnectionProviderAttribute.cs
- SerialPort.cs
- MetadataPropertyAttribute.cs
- WCFServiceClientProxyGenerator.cs
- VirtualizedItemProviderWrapper.cs
- NonVisualControlAttribute.cs
- ConnectAlgorithms.cs
- HashCodeCombiner.cs
- CallbackCorrelationInitializer.cs
- ThreadAttributes.cs
- LoadedOrUnloadedOperation.cs
- TabPage.cs
- CodeExpressionRuleDeclaration.cs
- BrowserCapabilitiesCompiler.cs
- XmlQuerySequence.cs
- TextEffect.cs
- DecimalAnimation.cs
- XhtmlMobileTextWriter.cs
- EmptyStringExpandableObjectConverter.cs
- DetailsViewDeleteEventArgs.cs
- DependencyPropertyDescriptor.cs
- DataListDesigner.cs
- ThousandthOfEmRealPoints.cs
- DataGridSortCommandEventArgs.cs
- LoginUtil.cs
- StrongNameKeyPair.cs
- DateBoldEvent.cs
- CodeDirectionExpression.cs
- ResourceWriter.cs
- InvokeProviderWrapper.cs
- StrongNameMembershipCondition.cs
- BinaryWriter.cs
- _SSPISessionCache.cs
- FontFamily.cs
- OdbcPermission.cs
- Parser.cs
- CommandID.cs
- FontNameEditor.cs
- IntMinMaxAggregationOperator.cs
- ParallelActivityDesigner.cs
- FixedStringLookup.cs
- HtmlUtf8RawTextWriter.cs
- SqlUdtInfo.cs
- IImplicitResourceProvider.cs
- OpCodes.cs
- ToolStripDropDownItemDesigner.cs
- ReadOnlyPermissionSet.cs
- TypeCollectionDesigner.xaml.cs
- ContextMenuStrip.cs
- BasicExpandProvider.cs
- EntityCommandCompilationException.cs
- XmlDomTextWriter.cs
- FontFamilyValueSerializer.cs
- BitmapEffectInputConnector.cs
- EtwTrackingParticipant.cs
- OdbcRowUpdatingEvent.cs
- NativeMethods.cs
- SynchronizationContext.cs
- SelectionChangedEventArgs.cs
- SqlClientWrapperSmiStreamChars.cs
- MexHttpBindingElement.cs
- CapabilitiesState.cs
- QuestionEventArgs.cs
- XmlSchemaElement.cs
- TriggerCollection.cs
- ServicePoint.cs
- DependencySource.cs
- ColorMap.cs
- SupportsEventValidationAttribute.cs
- NumericPagerField.cs
- WindowsPen.cs
- CompilerGlobalScopeAttribute.cs
- QueueTransferProtocol.cs
- FunctionCommandText.cs
- FixedSOMPage.cs
- _NegoState.cs
- HashCoreRequest.cs
- XmlArrayItemAttributes.cs
- WindowsRichEditRange.cs
- GeneralTransform3DGroup.cs
- SerTrace.cs
- OleDbInfoMessageEvent.cs
- TreeBuilderBamlTranslator.cs
- FormDesigner.cs
- WSFederationHttpBindingElement.cs
- CounterSample.cs
- ListDictionaryInternal.cs
- InputScopeAttribute.cs
- DBSchemaRow.cs
- ScrollViewerAutomationPeer.cs
- EntityDataSourceQueryBuilder.cs
- DrawingAttributesDefaultValueFactory.cs
- IPGlobalProperties.cs
- TableCellAutomationPeer.cs
- ClusterRegistryConfigurationProvider.cs
- WindowsSpinner.cs
- MenuBase.cs
- EdmEntityTypeAttribute.cs