Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeFileMapViewHandle.cs / 1 / SafeFileMapViewHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileMapViewHandle ** **Author: Brian Grunkemeyer ([....]) ** ** A wrapper for handles returned from MapViewOfFile, used ** for shared memory. ** ** Date: August 7, 2002 ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.ConstrainedExecution; namespace Microsoft.Win32.SafeHandles { [HostProtectionAttribute(MayLeakOnAbort = true)] [SuppressUnmanagedCodeSecurityAttribute] internal sealed class SafeFileMapViewHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that MapViewOfFile returns 0 on failure internal SafeFileMapViewHandle() : base(true) {} [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)] internal static extern SafeFileMapViewHandle MapViewOfFile(SafeFileMappingHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap); [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool UnmapViewOfFile(IntPtr handle); override protected bool ReleaseHandle() { return UnmapViewOfFile(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileMapViewHandle ** **Author: Brian Grunkemeyer ([....]) ** ** A wrapper for handles returned from MapViewOfFile, used ** for shared memory. ** ** Date: August 7, 2002 ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.ConstrainedExecution; namespace Microsoft.Win32.SafeHandles { [HostProtectionAttribute(MayLeakOnAbort = true)] [SuppressUnmanagedCodeSecurityAttribute] internal sealed class SafeFileMapViewHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that MapViewOfFile returns 0 on failure internal SafeFileMapViewHandle() : base(true) {} [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)] internal static extern SafeFileMapViewHandle MapViewOfFile(SafeFileMappingHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap); [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool UnmapViewOfFile(IntPtr handle); override protected bool ReleaseHandle() { return UnmapViewOfFile(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
- SingleKeyFrameCollection.cs
- ImageConverter.cs
- HtmlElementErrorEventArgs.cs
- BypassElementCollection.cs
- ProcessThread.cs
- ManagementBaseObject.cs
- SoapAttributeOverrides.cs
- ComEventsMethod.cs
- SQLBytesStorage.cs
- Run.cs
- WorkflowServiceNamespace.cs
- RtfToXamlReader.cs
- CancelEventArgs.cs
- CodeExporter.cs
- TcpAppDomainProtocolHandler.cs
- MemoryPressure.cs
- ComplexPropertyEntry.cs
- MultiBinding.cs
- BaseTreeIterator.cs
- FontCollection.cs
- Aggregates.cs
- SAPICategories.cs
- XmlCharType.cs
- ArrayTypeMismatchException.cs
- HealthMonitoringSection.cs
- ProviderBase.cs
- DataBinder.cs
- FilteredReadOnlyMetadataCollection.cs
- Italic.cs
- DocumentEventArgs.cs
- DispatcherHooks.cs
- HelloMessageApril2005.cs
- IPEndPoint.cs
- METAHEADER.cs
- RijndaelManaged.cs
- ApplicationProxyInternal.cs
- Menu.cs
- RuleSettings.cs
- ConnectionStringSettingsCollection.cs
- XmlStringTable.cs
- PreservationFileReader.cs
- ClientRolePrincipal.cs
- UserPersonalizationStateInfo.cs
- recordstate.cs
- DataGridViewTextBoxEditingControl.cs
- MasterPageCodeDomTreeGenerator.cs
- AutomationElementIdentifiers.cs
- ControlBindingsCollection.cs
- AsyncOperationContext.cs
- ImmutableCollection.cs
- Size.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- BindValidator.cs
- TriggerAction.cs
- EventDescriptorCollection.cs
- XMLDiffLoader.cs
- ContentPlaceHolder.cs
- StoreContentChangedEventArgs.cs
- XPathSelectionIterator.cs
- UriExt.cs
- WebPartsSection.cs
- securestring.cs
- NativeCppClassAttribute.cs
- GlobalId.cs
- MessageBox.cs
- WebPartMenu.cs
- OleDbCommand.cs
- CompressEmulationStream.cs
- PageRanges.cs
- TableCellAutomationPeer.cs
- FastEncoder.cs
- DataViewSettingCollection.cs
- ParamArrayAttribute.cs
- PersonalizableAttribute.cs
- BorderSidesEditor.cs
- TypeExtensionConverter.cs
- DesignTable.cs
- XmlAttributeAttribute.cs
- wmiprovider.cs
- NullableConverter.cs
- TaskHelper.cs
- AutomationPatternInfo.cs
- XmlDataCollection.cs
- TypeUtils.cs
- SspiHelper.cs
- EarlyBoundInfo.cs
- ScrollProviderWrapper.cs
- Volatile.cs
- AccessedThroughPropertyAttribute.cs
- ProcessingInstructionAction.cs
- SpecularMaterial.cs
- ContractListAdapter.cs
- ProcessStartInfo.cs
- FormatConvertedBitmap.cs
- WindowVisualStateTracker.cs
- RtType.cs
- ChineseLunisolarCalendar.cs
- SimpleWebHandlerParser.cs
- InProcStateClientManager.cs
- DeobfuscatingStream.cs