Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TemplateContentLoader.cs
- HtmlControlPersistable.cs
- IgnoreFileBuildProvider.cs
- FrugalList.cs
- TargetFrameworkUtil.cs
- DiscardableAttribute.cs
- SafeFileMappingHandle.cs
- UnionCodeGroup.cs
- Type.cs
- CellParaClient.cs
- InvalidAsynchronousStateException.cs
- DropDownList.cs
- DataRowComparer.cs
- SourceLineInfo.cs
- DbParameterCollection.cs
- mongolianshape.cs
- XmlRootAttribute.cs
- Utils.cs
- OdbcPermission.cs
- XmlSchemaSimpleTypeList.cs
- TrackBarDesigner.cs
- PersonalizableAttribute.cs
- SimpleBitVector32.cs
- login.cs
- LookupBindingPropertiesAttribute.cs
- XmlSerializationReader.cs
- Storyboard.cs
- CellParaClient.cs
- MailWebEventProvider.cs
- _Rfc2616CacheValidators.cs
- ContainerTracking.cs
- Lease.cs
- TreePrinter.cs
- StylusCaptureWithinProperty.cs
- StagingAreaInputItem.cs
- SerializationException.cs
- Label.cs
- Knowncolors.cs
- SqlFactory.cs
- PageHandlerFactory.cs
- DesignOnlyAttribute.cs
- Renderer.cs
- BlockExpression.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DataGridRelationshipRow.cs
- SafeHandle.cs
- CellQuery.cs
- OdbcError.cs
- OpenTypeLayout.cs
- AsymmetricKeyExchangeFormatter.cs
- SqlSupersetValidator.cs
- WorkflowWebHostingModule.cs
- TraceContext.cs
- DataMemberFieldConverter.cs
- Model3D.cs
- Comparer.cs
- FontDifferentiator.cs
- BitmapEffectGroup.cs
- CompositionAdorner.cs
- ByteStack.cs
- ServiceMemoryGates.cs
- LayoutManager.cs
- ClassicBorderDecorator.cs
- ChooseAction.cs
- BitmapEffectInputData.cs
- SystemResourceHost.cs
- FormatSettings.cs
- SqlProfileProvider.cs
- ResXDataNode.cs
- RegisteredExpandoAttribute.cs
- XmlDownloadManager.cs
- TableCellCollection.cs
- DropShadowEffect.cs
- MemberMemberBinding.cs
- Parser.cs
- RSAPKCS1KeyExchangeFormatter.cs
- WindowAutomationPeer.cs
- ShutDownListener.cs
- ResolveMatchesMessage11.cs
- DelegateBodyWriter.cs
- AtomParser.cs
- CodePageUtils.cs
- QilExpression.cs
- HwndSource.cs
- SchemaImporterExtensionElement.cs
- DataStorage.cs
- Renderer.cs
- RowParagraph.cs
- SqlHelper.cs
- DataFormats.cs
- DataGridViewComboBoxColumn.cs
- SqlCacheDependencyDatabase.cs
- AppDomainShutdownMonitor.cs
- TransformPattern.cs
- XmlSchemaInfo.cs
- AudioFileOut.cs
- XmlSchemaAttributeGroup.cs
- FontWeightConverter.cs
- XmlDataSourceView.cs
- HtmlInputPassword.cs