Code:
/ DotNET / DotNET / 8.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
- SelectionEditor.cs
- WindowsTokenRoleProvider.cs
- SoapEnumAttribute.cs
- MimeReturn.cs
- GridViewColumnHeaderAutomationPeer.cs
- NamespaceList.cs
- RelatedEnd.cs
- SqlExpander.cs
- XamlHostingSection.cs
- FileDialogCustomPlace.cs
- DtdParser.cs
- FieldAccessException.cs
- BufferedStream.cs
- SymbolMethod.cs
- UnknownBitmapEncoder.cs
- CodeParameterDeclarationExpressionCollection.cs
- UIElementCollection.cs
- SQLRoleProvider.cs
- Metafile.cs
- ToolStripGrip.cs
- SafeUserTokenHandle.cs
- DoubleAnimationBase.cs
- BaseAsyncResult.cs
- SubclassTypeValidatorAttribute.cs
- BitStack.cs
- ClockController.cs
- ObjectConverter.cs
- Enumerable.cs
- PersonalizableTypeEntry.cs
- OracleRowUpdatedEventArgs.cs
- TypefaceMetricsCache.cs
- ParallelEnumerableWrapper.cs
- WebReferenceOptions.cs
- MissingMethodException.cs
- XmlDigitalSignatureProcessor.cs
- MatrixKeyFrameCollection.cs
- AssemblyUtil.cs
- GeneralTransform3DGroup.cs
- CollectionConverter.cs
- WebPartVerb.cs
- AdCreatedEventArgs.cs
- Property.cs
- InvalidCommandTreeException.cs
- Interlocked.cs
- DesignColumn.cs
- ScriptResourceAttribute.cs
- _NegoStream.cs
- HTMLTagNameToTypeMapper.cs
- WebChannelFactory.cs
- DoubleAnimation.cs
- BigInt.cs
- MessageQueue.cs
- WindowsListViewGroupSubsetLink.cs
- MatrixAnimationUsingPath.cs
- XmlElementAttributes.cs
- CodeTypeConstructor.cs
- TextEditor.cs
- Process.cs
- UnicodeEncoding.cs
- StreamSecurityUpgradeInitiatorBase.cs
- CapabilitiesAssignment.cs
- ComboBox.cs
- DbProviderFactoriesConfigurationHandler.cs
- PromptStyle.cs
- EventProxy.cs
- LabelAutomationPeer.cs
- ScrollBarRenderer.cs
- MinimizableAttributeTypeConverter.cs
- DataGridPagingPage.cs
- ResourceDisplayNameAttribute.cs
- EditorServiceContext.cs
- XPathAncestorQuery.cs
- ActivityTrace.cs
- Configuration.cs
- ReversePositionQuery.cs
- InlinedAggregationOperatorEnumerator.cs
- TriggerCollection.cs
- BookmarkUndoUnit.cs
- FilteredXmlReader.cs
- ZipIOExtraFieldElement.cs
- ActivationArguments.cs
- ErasingStroke.cs
- Function.cs
- GenericTypeParameterBuilder.cs
- SqlDataSourceTableQuery.cs
- Rotation3DAnimationBase.cs
- MemberMaps.cs
- DiscoveryClientOutputChannel.cs
- Validator.cs
- HtmlInputReset.cs
- CornerRadiusConverter.cs
- _Events.cs
- PathFigure.cs
- AppDomain.cs
- FillBehavior.cs
- AstTree.cs
- ParallelDesigner.cs
- LicenseProviderAttribute.cs
- SocketInformation.cs
- Decimal.cs