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
- WmpBitmapDecoder.cs
- GridViewUpdatedEventArgs.cs
- SynchronizedInputHelper.cs
- Debug.cs
- GroupJoinQueryOperator.cs
- ViewEventArgs.cs
- Pair.cs
- COM2ExtendedTypeConverter.cs
- EasingKeyFrames.cs
- LicenseContext.cs
- CoreChannel.cs
- MergeLocalizationDirectives.cs
- DesignTable.cs
- MemberRelationshipService.cs
- Polyline.cs
- EdmScalarPropertyAttribute.cs
- ComponentManagerBroker.cs
- PageParser.cs
- Base64Stream.cs
- WebUtil.cs
- ToolBarPanel.cs
- MeasureItemEvent.cs
- ClientFormsIdentity.cs
- Facet.cs
- FormParameter.cs
- MulticastDelegate.cs
- ObfuscationAttribute.cs
- ByteAnimation.cs
- ServiceDurableInstance.cs
- IndexOutOfRangeException.cs
- ContextMenuService.cs
- ExpressionNode.cs
- SemanticBasicElement.cs
- Win32Native.cs
- SafeRightsManagementPubHandle.cs
- XPathNavigatorReader.cs
- HuffmanTree.cs
- ReferencedAssemblyResolver.cs
- CalendarDateRangeChangingEventArgs.cs
- FixedSOMFixedBlock.cs
- WindowsGraphics2.cs
- EnumMemberAttribute.cs
- AutomationPatternInfo.cs
- Table.cs
- Substitution.cs
- StorageMappingItemLoader.cs
- EncryptedData.cs
- HwndSourceParameters.cs
- StackSpiller.Generated.cs
- EntityViewGenerationConstants.cs
- TrackingMemoryStreamFactory.cs
- ResourceDisplayNameAttribute.cs
- ProfilePropertySettings.cs
- XPathSelectionIterator.cs
- GatewayIPAddressInformationCollection.cs
- CodeTypeReferenceSerializer.cs
- QueryOperationResponseOfT.cs
- RegisteredScript.cs
- OdbcCommandBuilder.cs
- TriState.cs
- Site.cs
- TextEffect.cs
- StringExpressionSet.cs
- Animatable.cs
- DesignerTransactionCloseEvent.cs
- RightNameExpirationInfoPair.cs
- MultiBindingExpression.cs
- SpotLight.cs
- ExpressionsCollectionConverter.cs
- MailDefinition.cs
- RemoteDebugger.cs
- ItemsPanelTemplate.cs
- HtmlInputImage.cs
- TypeBrowserDialog.cs
- CollectionMarkupSerializer.cs
- RoutedEventHandlerInfo.cs
- PasswordDeriveBytes.cs
- ToolStripPanelRow.cs
- UIElement3D.cs
- ProfileManager.cs
- TreeWalker.cs
- SoapFault.cs
- UpdateCompiler.cs
- TextPointer.cs
- DataSourceExpressionCollection.cs
- UnsafeNativeMethods.cs
- CodeExporter.cs
- sqlstateclientmanager.cs
- FunctionDescription.cs
- HeaderCollection.cs
- SourceFileInfo.cs
- BlurBitmapEffect.cs
- UpdateCompiler.cs
- ApplicationSettingsBase.cs
- HashCodeCombiner.cs
- GridLength.cs
- PublisherMembershipCondition.cs
- MobileCapabilities.cs
- ToolStripSettings.cs
- WinEventTracker.cs