Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeFileMapViewHandle.cs / 1305376 / 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; using System.Runtime.Versioning; 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)] [ResourceExposure(ResourceScope.Machine)] internal static extern SafeFileMapViewHandle MapViewOfFile(SafeFileMappingHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap); [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ResourceExposure(ResourceScope.None)] [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; using System.Runtime.Versioning; 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)] [ResourceExposure(ResourceScope.Machine)] internal static extern SafeFileMapViewHandle MapViewOfFile(SafeFileMappingHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap); [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ResourceExposure(ResourceScope.None)] [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
- Style.cs
- ServiceContractDetailViewControl.cs
- PathNode.cs
- DataException.cs
- SQLBytes.cs
- MultipartIdentifier.cs
- FtpWebResponse.cs
- FlowPosition.cs
- EncoderParameters.cs
- InstanceDataCollection.cs
- CustomActivityDesigner.cs
- EncryptedType.cs
- SplashScreenNativeMethods.cs
- ScalarType.cs
- MemberHolder.cs
- Help.cs
- ComponentConverter.cs
- BookmarkCallbackWrapper.cs
- SchemaImporter.cs
- ColumnMapVisitor.cs
- ObjectListDesigner.cs
- DrawListViewColumnHeaderEventArgs.cs
- TextRangeAdaptor.cs
- PrivilegeNotHeldException.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- DbUpdateCommandTree.cs
- XsdValidatingReader.cs
- EntityTransaction.cs
- TraceSource.cs
- WebPartConnectionsCancelVerb.cs
- Scene3D.cs
- SymbolType.cs
- NTAccount.cs
- IDReferencePropertyAttribute.cs
- IDReferencePropertyAttribute.cs
- DataServiceResponse.cs
- XmlSchemaRedefine.cs
- GridViewCommandEventArgs.cs
- _UriSyntax.cs
- ColumnMapCopier.cs
- EventLogPermission.cs
- OleDbDataReader.cs
- ContainerActivationHelper.cs
- TimeoutConverter.cs
- Latin1Encoding.cs
- EdmError.cs
- FixedNode.cs
- InstanceDescriptor.cs
- ProtocolsConfigurationHandler.cs
- DefaultBindingPropertyAttribute.cs
- InputReferenceExpression.cs
- MenuItemBinding.cs
- ValidationPropertyAttribute.cs
- CodeVariableReferenceExpression.cs
- SelectionChangedEventArgs.cs
- XmlILModule.cs
- Int64AnimationUsingKeyFrames.cs
- Timer.cs
- UnsafeNativeMethodsCLR.cs
- SafeThemeHandle.cs
- ValidatingPropertiesEventArgs.cs
- DoubleLink.cs
- TCEAdapterGenerator.cs
- Renderer.cs
- ArithmeticException.cs
- WebServiceParameterData.cs
- OutputBuffer.cs
- DeferrableContent.cs
- StylusPointPropertyInfo.cs
- LockRecoveryTask.cs
- TraceContext.cs
- NativeMethods.cs
- UnsafeNativeMethods.cs
- DataGridView.cs
- DropTarget.cs
- CssStyleCollection.cs
- XComponentModel.cs
- InputLanguageCollection.cs
- SqlConnectionStringBuilder.cs
- ProxyHwnd.cs
- NamespaceDecl.cs
- ManifestResourceInfo.cs
- ClientCultureInfo.cs
- ListBindingConverter.cs
- DesigntimeLicenseContextSerializer.cs
- _TLSstream.cs
- UniqueIdentifierService.cs
- HexParser.cs
- UndoEngine.cs
- ConfigXmlWhitespace.cs
- QilBinary.cs
- PropertyDescriptor.cs
- HostedHttpTransportManager.cs
- ProcessManager.cs
- Button.cs
- WebPartConnectionsCloseVerb.cs
- Panel.cs
- AspProxy.cs
- RIPEMD160.cs
- TextProperties.cs