Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SingleAnimationBase.cs
- SR.Designer.cs
- AuthenticationConfig.cs
- XmlSchemaGroupRef.cs
- Menu.cs
- Selection.cs
- UTF8Encoding.cs
- ViewPort3D.cs
- MachineKeySection.cs
- Subtree.cs
- ReflectionUtil.cs
- BuiltInPermissionSets.cs
- WebPartTransformer.cs
- DataGridViewRow.cs
- SessionEndingCancelEventArgs.cs
- HttpServerChannel.cs
- TimeZone.cs
- CalloutQueueItem.cs
- XmlSchemaInfo.cs
- AmbientLight.cs
- DynamicValidator.cs
- ToolboxComponentsCreatingEventArgs.cs
- RowCache.cs
- HttpHandlerAction.cs
- ScriptingRoleServiceSection.cs
- DecodeHelper.cs
- AppDomainManager.cs
- GridItemCollection.cs
- Trace.cs
- CharacterString.cs
- EDesignUtil.cs
- DataFormat.cs
- ContentTextAutomationPeer.cs
- StorageTypeMapping.cs
- CallInfo.cs
- MessagingDescriptionAttribute.cs
- TraceSwitch.cs
- TabControlDesigner.cs
- LoginUtil.cs
- Regex.cs
- hresults.cs
- TextTreeUndo.cs
- ChildrenQuery.cs
- Vars.cs
- XmlValueConverter.cs
- Debugger.cs
- XmlBinaryReader.cs
- StrokeCollectionConverter.cs
- StringStorage.cs
- ToolStripRenderer.cs
- ContentFilePart.cs
- DataKeyCollection.cs
- PrintDialog.cs
- StandardBindingCollectionElement.cs
- SchemaImporterExtension.cs
- SigningCredentials.cs
- ToolConsole.cs
- ConstraintCollection.cs
- FrameworkEventSource.cs
- TemplateParser.cs
- HttpProfileBase.cs
- Visitor.cs
- DataViewListener.cs
- RSAOAEPKeyExchangeFormatter.cs
- BrowsableAttribute.cs
- XmlAttributeCache.cs
- PeerNameRegistration.cs
- NativeMethods.cs
- TypeTypeConverter.cs
- SelectQueryOperator.cs
- EventEntry.cs
- RequestContext.cs
- EditCommandColumn.cs
- ApplyTemplatesAction.cs
- ServiceDescription.cs
- CodeMemberEvent.cs
- XmlSecureResolver.cs
- OdbcErrorCollection.cs
- TraceSwitch.cs
- ActiveXHelper.cs
- NotificationContext.cs
- XsltSettings.cs
- SecurityTokenTypes.cs
- COM2TypeInfoProcessor.cs
- RuntimeResourceSet.cs
- dbenumerator.cs
- WithStatement.cs
- Bezier.cs
- MatcherBuilder.cs
- QuadTree.cs
- SQLBytesStorage.cs
- ViewBase.cs
- FigureHelper.cs
- BamlStream.cs
- EntityDataSourceWrapperCollection.cs
- Line.cs
- OleDbCommandBuilder.cs
- UniqueConstraint.cs
- JapaneseLunisolarCalendar.cs
- SiteMapNodeItem.cs