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
- PackWebRequest.cs
- TextInfo.cs
- BasicCellRelation.cs
- GPRECT.cs
- XmlSchemaParticle.cs
- KeyFrames.cs
- ClientApiGenerator.cs
- SecurityToken.cs
- SecurityHelper.cs
- FontDifferentiator.cs
- CharAnimationUsingKeyFrames.cs
- SQLDateTime.cs
- DataObjectSettingDataEventArgs.cs
- UnknownExceptionActionHelper.cs
- HTMLTextWriter.cs
- PagerStyle.cs
- InheritanceContextHelper.cs
- TemplateBindingExpression.cs
- StorageMappingFragment.cs
- DocComment.cs
- _AutoWebProxyScriptEngine.cs
- SR.cs
- BindingElementCollection.cs
- Image.cs
- ResourceAttributes.cs
- WindowPattern.cs
- EventDriven.cs
- MediaSystem.cs
- PartBasedPackageProperties.cs
- InvariantComparer.cs
- ObjectStateFormatter.cs
- ComAdminInterfaces.cs
- TogglePatternIdentifiers.cs
- DbProviderFactory.cs
- ValidationHelper.cs
- DocumentViewerBase.cs
- CompressedStack.cs
- HMACRIPEMD160.cs
- OneWayBindingElementImporter.cs
- TextServicesLoader.cs
- ElementsClipboardData.cs
- x509utils.cs
- PassportPrincipal.cs
- XamlFigureLengthSerializer.cs
- CodeDomExtensionMethods.cs
- DefaultPrintController.cs
- Int16AnimationBase.cs
- ResourceDisplayNameAttribute.cs
- BasePattern.cs
- SafeSecurityHandles.cs
- ConnectionString.cs
- BaseResourcesBuildProvider.cs
- DefaultMemberAttribute.cs
- PackageRelationship.cs
- XsdBuilder.cs
- DictionarySectionHandler.cs
- BaseDataList.cs
- ActivityWithResultWrapper.cs
- TransformCryptoHandle.cs
- ViewBox.cs
- StopRoutingHandler.cs
- Serializer.cs
- StorageEndPropertyMapping.cs
- ButtonBaseAdapter.cs
- InputDevice.cs
- Maps.cs
- RawStylusInputCustomData.cs
- CodeVariableReferenceExpression.cs
- PropertyRef.cs
- Object.cs
- HostedHttpTransportManager.cs
- MetafileHeaderWmf.cs
- SelectionEditingBehavior.cs
- SafeNativeMemoryHandle.cs
- AlphabeticalEnumConverter.cs
- XmlBinaryWriter.cs
- MdImport.cs
- safelinkcollection.cs
- FrameSecurityDescriptor.cs
- FormsAuthentication.cs
- SchemaTypeEmitter.cs
- SimpleRecyclingCache.cs
- PerformanceCounterPermissionEntry.cs
- RuleProcessor.cs
- CompositeCollection.cs
- HTMLTextWriter.cs
- ContainerUtilities.cs
- SqlFunctionAttribute.cs
- XmlComment.cs
- ToolZone.cs
- Roles.cs
- SamlConditions.cs
- StringWriter.cs
- CellIdBoolean.cs
- SpecialTypeDataContract.cs
- TextServicesLoader.cs
- MarshalByRefObject.cs
- MessageTraceRecord.cs
- StreamingContext.cs
- SettingsBase.cs