Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- NetworkInterface.cs
- SqlFunctionAttribute.cs
- TextControlDesigner.cs
- CssTextWriter.cs
- Imaging.cs
- XmlChildNodes.cs
- GroupItemAutomationPeer.cs
- Helper.cs
- AuthenticateEventArgs.cs
- MeshGeometry3D.cs
- CuspData.cs
- CryptoConfig.cs
- MarkupExtensionParser.cs
- ObjectDataSourceChooseMethodsPanel.cs
- EncodingDataItem.cs
- ConfigDefinitionUpdates.cs
- UnsignedPublishLicense.cs
- StoragePropertyMapping.cs
- XmlUrlResolver.cs
- InstanceKeyCollisionException.cs
- MetadataFile.cs
- SecurityDescriptor.cs
- RotateTransform3D.cs
- ConfigXmlComment.cs
- XmlSchemaCollection.cs
- PropertyMappingExceptionEventArgs.cs
- TemplateContainer.cs
- AspCompat.cs
- WebPartConnectionsCancelEventArgs.cs
- peernodeimplementation.cs
- QueryCorrelationInitializer.cs
- ContentPropertyAttribute.cs
- CommandField.cs
- ProxyGenerationError.cs
- NegotiateStream.cs
- DrawingBrush.cs
- DoubleLink.cs
- LocationSectionRecord.cs
- WindowsFormsSectionHandler.cs
- OutputScopeManager.cs
- InteropExecutor.cs
- StrongName.cs
- PointCollection.cs
- CategoryValueConverter.cs
- CustomLineCap.cs
- ImageSource.cs
- HostedBindingBehavior.cs
- WebSysDescriptionAttribute.cs
- PropertyMetadata.cs
- AutomationElement.cs
- AdCreatedEventArgs.cs
- ProxyWebPartConnectionCollection.cs
- IndentTextWriter.cs
- ResourcePermissionBaseEntry.cs
- ToolBar.cs
- Parser.cs
- AnimationStorage.cs
- ImageMapEventArgs.cs
- VariableQuery.cs
- LinqExpressionNormalizer.cs
- FacetChecker.cs
- DPCustomTypeDescriptor.cs
- ObjectQuery_EntitySqlExtensions.cs
- CodeIdentifier.cs
- CookielessHelper.cs
- UriTemplateVariablePathSegment.cs
- Encoder.cs
- NullToBooleanConverter.cs
- DockPanel.cs
- SmiXetterAccessMap.cs
- ParseElement.cs
- ImageClickEventArgs.cs
- FlowDocumentPage.cs
- AccessText.cs
- TypeValidationEventArgs.cs
- XsltSettings.cs
- SoapAttributeOverrides.cs
- TTSVoice.cs
- DataSpaceManager.cs
- Int32AnimationBase.cs
- CaretElement.cs
- QuaternionRotation3D.cs
- Environment.cs
- GraphicsState.cs
- PassportAuthentication.cs
- SafeWaitHandle.cs
- ExtendedPropertyDescriptor.cs
- StateFinalizationDesigner.cs
- ClipboardProcessor.cs
- FloaterParaClient.cs
- dataprotectionpermission.cs
- XmlAttributeHolder.cs
- TypeToArgumentTypeConverter.cs
- RewritingPass.cs
- Size.cs
- Trace.cs
- IsolatedStorageFile.cs
- FieldBuilder.cs
- MetadataWorkspace.cs
- ChunkedMemoryStream.cs