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
- CodeDirectionExpression.cs
- PlanCompiler.cs
- WorkflowServiceHost.cs
- SiteOfOriginContainer.cs
- ThicknessConverter.cs
- SignerInfo.cs
- WebPartDisplayModeCancelEventArgs.cs
- Normalization.cs
- QuaternionRotation3D.cs
- MapPathBasedVirtualPathProvider.cs
- MasterPageBuildProvider.cs
- AxWrapperGen.cs
- TransformerConfigurationWizardBase.cs
- InstalledFontCollection.cs
- FileVersion.cs
- BamlLocalizationDictionary.cs
- Validator.cs
- TypeDescriptor.cs
- Bidi.cs
- BitmapCodecInfoInternal.cs
- XmlText.cs
- VerificationException.cs
- TimelineGroup.cs
- VersionValidator.cs
- ICspAsymmetricAlgorithm.cs
- ParseElementCollection.cs
- SiteMap.cs
- BitmapEncoder.cs
- FloaterParaClient.cs
- SignatureHelper.cs
- SByte.cs
- IndexExpression.cs
- SourceFileBuildProvider.cs
- ReliabilityContractAttribute.cs
- CommandEventArgs.cs
- Rect.cs
- FilteredSchemaElementLookUpTable.cs
- LinkUtilities.cs
- XmlElementAttributes.cs
- TransactionState.cs
- MgmtResManager.cs
- Scalars.cs
- DocumentScope.cs
- BinaryNode.cs
- RuleSettingsCollection.cs
- Transform.cs
- ChangeNode.cs
- HostProtectionException.cs
- GetIndexBinder.cs
- PeekCompletedEventArgs.cs
- CompiledIdentityConstraint.cs
- PolicyConversionContext.cs
- LateBoundBitmapDecoder.cs
- QueueException.cs
- AssemblyHelper.cs
- BindingOperations.cs
- TextElementCollection.cs
- StreamReader.cs
- XmlNamespaceMapping.cs
- EmptyReadOnlyDictionaryInternal.cs
- TrackingStringDictionary.cs
- EUCJPEncoding.cs
- HttpClientCertificate.cs
- FloaterBaseParagraph.cs
- ListBindingConverter.cs
- TabletCollection.cs
- LinkClickEvent.cs
- RowUpdatedEventArgs.cs
- XmlWriterTraceListener.cs
- DataGridViewButtonCell.cs
- MethodCallConverter.cs
- AttachmentCollection.cs
- KeyConverter.cs
- SafeIUnknown.cs
- BindableTemplateBuilder.cs
- RecordBuilder.cs
- ScaleTransform.cs
- VerificationAttribute.cs
- VirtualPathUtility.cs
- objectresult_tresulttype.cs
- WebColorConverter.cs
- CompilerInfo.cs
- SizeF.cs
- Brush.cs
- PenLineCapValidation.cs
- RadioButtonAutomationPeer.cs
- InputLanguageSource.cs
- FastPropertyAccessor.cs
- TailPinnedEventArgs.cs
- CopyNamespacesAction.cs
- TableRowCollection.cs
- ViewManagerAttribute.cs
- OwnerDrawPropertyBag.cs
- TTSEngineTypes.cs
- TextBox.cs
- FlowDocumentPaginator.cs
- DataGridViewCheckBoxColumn.cs
- glyphs.cs
- ResponseBodyWriter.cs
- ProviderIncompatibleException.cs