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
- MatrixTransform3D.cs
- DeclaredTypeElementCollection.cs
- JavaScriptSerializer.cs
- RequiredAttributeAttribute.cs
- Helpers.cs
- Brushes.cs
- MessageSecurityOverTcp.cs
- CodeStatementCollection.cs
- WebScriptMetadataFormatter.cs
- WindowsGraphics.cs
- BinaryParser.cs
- VirtualPathUtility.cs
- FormsAuthenticationTicket.cs
- FileCodeGroup.cs
- DataViewManager.cs
- Geometry3D.cs
- ProtectedProviderSettings.cs
- ValidationHelper.cs
- sqlstateclientmanager.cs
- CasesDictionary.cs
- AssemblyHash.cs
- RefType.cs
- XmlFormatWriterGenerator.cs
- TabControlCancelEvent.cs
- ButtonBaseAdapter.cs
- ScriptServiceAttribute.cs
- ResourceReferenceExpressionConverter.cs
- CapabilitiesRule.cs
- ThreadInterruptedException.cs
- NavigatorOutput.cs
- ExtendedPropertyCollection.cs
- ComplexLine.cs
- FormViewInsertedEventArgs.cs
- Operand.cs
- GACIdentityPermission.cs
- ValueType.cs
- Thickness.cs
- Stylesheet.cs
- LocalizableResourceBuilder.cs
- XmlSchemaAttributeGroup.cs
- MouseDevice.cs
- HttpCapabilitiesEvaluator.cs
- SoapServerMethod.cs
- TabItemAutomationPeer.cs
- HtmlFormWrapper.cs
- Effect.cs
- HttpException.cs
- BaseProcessor.cs
- InvalidFilterCriteriaException.cs
- Logging.cs
- ElementFactory.cs
- NativeMethods.cs
- BaseParaClient.cs
- ToolboxComponentsCreatingEventArgs.cs
- SqlDataSourceStatusEventArgs.cs
- BitmapEffectInputConnector.cs
- MatrixCamera.cs
- DataGridViewAutoSizeModeEventArgs.cs
- PreviewPageInfo.cs
- SubtreeProcessor.cs
- TargetInvocationException.cs
- path.cs
- UIElementCollection.cs
- CompilationRelaxations.cs
- CounterSampleCalculator.cs
- TdsParser.cs
- GeneralTransform3D.cs
- ResourceSetExpression.cs
- JournalNavigationScope.cs
- Source.cs
- Panel.cs
- DataGridViewSortCompareEventArgs.cs
- OpenTypeLayout.cs
- CodeAttachEventStatement.cs
- KeysConverter.cs
- XmlSerializationWriter.cs
- TimeSpanMinutesConverter.cs
- WinEventQueueItem.cs
- Wildcard.cs
- ManifestSignatureInformation.cs
- ReadOnlyDictionary.cs
- ListControl.cs
- CompilerInfo.cs
- XmlCharType.cs
- SQLString.cs
- SequentialUshortCollection.cs
- SrgsDocument.cs
- DateTimeConstantAttribute.cs
- DataObjectSettingDataEventArgs.cs
- ColumnResizeAdorner.cs
- DocumentPageView.cs
- sqlstateclientmanager.cs
- WFItemsToSpacerVisibility.cs
- UriTemplateVariablePathSegment.cs
- IntSecurity.cs
- FilterElement.cs
- UxThemeWrapper.cs
- LateBoundBitmapDecoder.cs
- DynamicPropertyHolder.cs
- MessageQueueInstaller.cs