Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- RegionInfo.cs
- ConvertEvent.cs
- ExtentCqlBlock.cs
- InputMethod.cs
- AttributedMetaModel.cs
- UrlPath.cs
- ContainerVisual.cs
- OpacityConverter.cs
- httpstaticobjectscollection.cs
- VerticalAlignConverter.cs
- WorkflowInlining.cs
- DataGridViewRowPrePaintEventArgs.cs
- IDictionary.cs
- UnmanagedBitmapWrapper.cs
- DBAsyncResult.cs
- OleDbDataReader.cs
- ViewPort3D.cs
- CacheMemory.cs
- SafeReversePInvokeHandle.cs
- ListViewUpdatedEventArgs.cs
- Currency.cs
- SharedPerformanceCounter.cs
- DocumentOrderComparer.cs
- ManifestResourceInfo.cs
- BitmapData.cs
- LinqTreeNodeEvaluator.cs
- MetaChildrenColumn.cs
- UnauthorizedAccessException.cs
- SingleObjectCollection.cs
- BuildResult.cs
- ContentOperations.cs
- Speller.cs
- Tuple.cs
- ThreadExceptionEvent.cs
- AutomationPropertyInfo.cs
- GlyphingCache.cs
- SignatureToken.cs
- Typography.cs
- DriveInfo.cs
- ZipFileInfoCollection.cs
- Panel.cs
- PageParser.cs
- _ChunkParse.cs
- WindowShowOrOpenTracker.cs
- HebrewNumber.cs
- DataGridAddNewRow.cs
- TextAction.cs
- BaseProcessProtocolHandler.cs
- EntityDataSourceDesigner.cs
- DeleteHelper.cs
- Camera.cs
- HttpGetProtocolReflector.cs
- QueueException.cs
- TypeConverterAttribute.cs
- ByeOperationAsyncResult.cs
- ToolboxBitmapAttribute.cs
- SessionIDManager.cs
- CreateUserWizardStep.cs
- TempFiles.cs
- FileAccessException.cs
- RegisteredArrayDeclaration.cs
- CapacityStreamGeometryContext.cs
- ProfileSettings.cs
- InfoCardRSACryptoProvider.cs
- ObjectItemNoOpAssemblyLoader.cs
- MultiSelectRootGridEntry.cs
- WmlMobileTextWriter.cs
- ObservableCollection.cs
- CheckableControlBaseAdapter.cs
- errorpatternmatcher.cs
- MatrixValueSerializer.cs
- TableCell.cs
- SoapSchemaImporter.cs
- ButtonFieldBase.cs
- DebugTracing.cs
- ThicknessAnimationBase.cs
- FontWeightConverter.cs
- LambdaValue.cs
- MediaElement.cs
- RegionData.cs
- StrokeFIndices.cs
- ExternalCalls.cs
- Point4DValueSerializer.cs
- ServicePointManagerElement.cs
- ClientBuildManagerCallback.cs
- SQLDouble.cs
- UnmanagedMarshal.cs
- PaintValueEventArgs.cs
- KeyedCollection.cs
- BamlLocalizableResource.cs
- IpcServerChannel.cs
- BinaryObjectInfo.cs
- EntityDataReader.cs
- Transactions.cs
- InvalidPrinterException.cs
- ViewCellSlot.cs
- Empty.cs
- tabpagecollectioneditor.cs
- ParsedAttributeCollection.cs
- TemplateContentLoader.cs