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
- EndpointBehaviorElement.cs
- SqlDataSourceView.cs
- SystemIcmpV6Statistics.cs
- TextUtf8RawTextWriter.cs
- Assert.cs
- QueryOptionExpression.cs
- MasterPage.cs
- SkinBuilder.cs
- Binding.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- OracleFactory.cs
- WarningException.cs
- Roles.cs
- ChangePasswordAutoFormat.cs
- Utils.cs
- SymLanguageVendor.cs
- XmlEntityReference.cs
- TypedReference.cs
- TextOptionsInternal.cs
- BitmapSource.cs
- MultipartIdentifier.cs
- BinaryFormatterSinks.cs
- IncrementalHitTester.cs
- XmlSignatureManifest.cs
- ServiceContractGenerationContext.cs
- RegexMatch.cs
- ResourceContainer.cs
- PolyLineSegmentFigureLogic.cs
- ComponentEditorPage.cs
- ReliabilityContractAttribute.cs
- SecurityPolicySection.cs
- ImageCodecInfo.cs
- DesignerMetadata.cs
- SiteMapNodeCollection.cs
- CollectionChangeEventArgs.cs
- PieceDirectory.cs
- IndexOutOfRangeException.cs
- LinqDataSourceUpdateEventArgs.cs
- SqlConnectionStringBuilder.cs
- __Error.cs
- Attributes.cs
- ExpressionEvaluator.cs
- ButtonBase.cs
- ConnectionStringsExpressionBuilder.cs
- XmlDocument.cs
- SoapIgnoreAttribute.cs
- PassportAuthenticationModule.cs
- IntSecurity.cs
- FeatureSupport.cs
- HuffmanTree.cs
- FrugalMap.cs
- ListViewGroup.cs
- ScrollProviderWrapper.cs
- CryptoSession.cs
- SspiSafeHandles.cs
- CategoryAttribute.cs
- WindowsListViewGroup.cs
- PropertyChangedEventManager.cs
- ObjectListCommand.cs
- SafeEventLogReadHandle.cs
- DesigntimeLicenseContext.cs
- UnsafeMethods.cs
- DelegateSerializationHolder.cs
- WindowsSysHeader.cs
- BinaryFormatterWriter.cs
- DesignerSerializationOptionsAttribute.cs
- QilTargetType.cs
- BoundingRectTracker.cs
- Msmq4SubqueuePoisonHandler.cs
- SiteMapDataSourceView.cs
- HTMLTagNameToTypeMapper.cs
- _KerberosClient.cs
- AdornerDecorator.cs
- OleDbWrapper.cs
- HelloOperation11AsyncResult.cs
- TagMapInfo.cs
- TemplateControlParser.cs
- ContractValidationHelper.cs
- ExecutionTracker.cs
- SelectionItemProviderWrapper.cs
- ErrorWrapper.cs
- SQLResource.cs
- Keyboard.cs
- CalendarAutomationPeer.cs
- RtfToken.cs
- XmlSchemaExporter.cs
- RetrieveVirtualItemEventArgs.cs
- ReceiveParametersContent.cs
- CheckoutException.cs
- DiscriminatorMap.cs
- TimeoutValidationAttribute.cs
- SystemIPAddressInformation.cs
- MetadataArtifactLoaderComposite.cs
- ClientViaElement.cs
- ProfilePropertySettingsCollection.cs
- ElementNotEnabledException.cs
- SubMenuStyleCollection.cs
- RegistryExceptionHelper.cs
- RotationValidation.cs
- ToolStripButton.cs