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
- WebOperationContext.cs
- TemplateBindingExtension.cs
- path.cs
- SubMenuStyleCollection.cs
- EdmRelationshipRoleAttribute.cs
- ControlFilterExpression.cs
- DirectoryLocalQuery.cs
- Stacktrace.cs
- TreeViewCancelEvent.cs
- PerformanceCounterLib.cs
- SecurityException.cs
- Odbc32.cs
- PlaceHolder.cs
- exports.cs
- MergablePropertyAttribute.cs
- TrueReadOnlyCollection.cs
- PixelFormat.cs
- UserControlCodeDomTreeGenerator.cs
- RuntimeResourceSet.cs
- LockedAssemblyCache.cs
- HttpRequest.cs
- EnumerableValidator.cs
- SqlGenericUtil.cs
- FilteredAttributeCollection.cs
- HttpsHostedTransportConfiguration.cs
- MgmtConfigurationRecord.cs
- tabpagecollectioneditor.cs
- RowToParametersTransformer.cs
- RoleExceptions.cs
- InternalRelationshipCollection.cs
- FilterElement.cs
- ItemCheckEvent.cs
- SerializeAbsoluteContext.cs
- SiteOfOriginContainer.cs
- DateTimeStorage.cs
- ISCIIEncoding.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- altserialization.cs
- StreamInfo.cs
- cookie.cs
- LogManagementAsyncResult.cs
- InteropBitmapSource.cs
- DataGridViewElement.cs
- RequestCachePolicy.cs
- Bits.cs
- WinFormsUtils.cs
- ScriptHandlerFactory.cs
- WebConfigurationHostFileChange.cs
- SafeRegistryHandle.cs
- MachineKey.cs
- PinnedBufferMemoryStream.cs
- DockPattern.cs
- _ListenerAsyncResult.cs
- TracingConnectionListener.cs
- FormViewModeEventArgs.cs
- BitConverter.cs
- translator.cs
- BuildManager.cs
- TimeSpanConverter.cs
- KeyEvent.cs
- RegexCharClass.cs
- HebrewNumber.cs
- ClientSettingsSection.cs
- CompoundFileIOPermission.cs
- NativeMethods.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- ObjectDataSourceStatusEventArgs.cs
- ElementProxy.cs
- StringSource.cs
- XmlFormatReaderGenerator.cs
- HyperLinkColumn.cs
- BlobPersonalizationState.cs
- KeyInterop.cs
- AnimationClock.cs
- Char.cs
- SqlDataSourceConfigureSortForm.cs
- ColorIndependentAnimationStorage.cs
- CallId.cs
- ReadWriteObjectLock.cs
- AssemblyAttributesGoHere.cs
- IsolatedStorageFile.cs
- RowTypePropertyElement.cs
- Literal.cs
- NetworkInformationException.cs
- LogStore.cs
- MessageContractExporter.cs
- GridSplitter.cs
- GenericPrincipal.cs
- JournalEntryListConverter.cs
- PolicyConversionContext.cs
- NetworkStream.cs
- TimelineGroup.cs
- RowUpdatingEventArgs.cs
- ExpressionPrinter.cs
- RepeaterItemEventArgs.cs
- ThemeableAttribute.cs
- DataSourceView.cs
- TransformerConfigurationWizardBase.cs
- DependencyObjectProvider.cs
- GetKeyedHashRequest.cs