Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- LinqDataSourceContextEventArgs.cs
- ItemList.cs
- TextDocumentView.cs
- TextEditorContextMenu.cs
- RestHandlerFactory.cs
- ObjectQuery_EntitySqlExtensions.cs
- GZipStream.cs
- DataRowComparer.cs
- LostFocusEventManager.cs
- DataListItem.cs
- FormViewUpdateEventArgs.cs
- CatalogZone.cs
- ReadOnlyHierarchicalDataSource.cs
- JournalEntryStack.cs
- PropertyMapper.cs
- FlagsAttribute.cs
- ZoneIdentityPermission.cs
- HelpInfo.cs
- Console.cs
- CatalogZoneBase.cs
- XmlUTF8TextReader.cs
- CacheEntry.cs
- ApplicationSecurityManager.cs
- SchemaInfo.cs
- ListBindableAttribute.cs
- PenContext.cs
- uribuilder.cs
- PrimitiveType.cs
- QuotedPrintableStream.cs
- RestHandlerFactory.cs
- EmptyEnumerator.cs
- TraceSwitch.cs
- SiblingIterators.cs
- SqlParameter.cs
- ToolStripDropDown.cs
- CodeCastExpression.cs
- SafeJobHandle.cs
- DBCommandBuilder.cs
- oledbconnectionstring.cs
- XmlSchemaComplexContentExtension.cs
- ScriptingSectionGroup.cs
- TableLayoutRowStyleCollection.cs
- Empty.cs
- DisplayNameAttribute.cs
- IndicFontClient.cs
- Currency.cs
- ValueChangedEventManager.cs
- WebPartUserCapability.cs
- UrlUtility.cs
- NullableConverter.cs
- ScriptingJsonSerializationSection.cs
- RegexParser.cs
- AuthorizationRuleCollection.cs
- QueryPageSettingsEventArgs.cs
- RuleSettings.cs
- TileBrush.cs
- Int32Rect.cs
- XamlParser.cs
- FixedSOMPage.cs
- TargetParameterCountException.cs
- dtdvalidator.cs
- TablePattern.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- HwndSource.cs
- X509Chain.cs
- StructuralObject.cs
- CompositeScriptReference.cs
- Matrix3D.cs
- embossbitmapeffect.cs
- GrammarBuilderPhrase.cs
- FormViewDeleteEventArgs.cs
- InvalidProgramException.cs
- GridViewUpdatedEventArgs.cs
- SingleConverter.cs
- WebWorkflowRole.cs
- XmlSortKey.cs
- ClosableStream.cs
- GenericAuthenticationEventArgs.cs
- SaveFileDialog.cs
- ComPlusServiceLoader.cs
- TransformGroup.cs
- EventLogPermissionAttribute.cs
- XhtmlBasicPhoneCallAdapter.cs
- TagNameToTypeMapper.cs
- HttpStreamMessageEncoderFactory.cs
- ChannelBinding.cs
- ZipFileInfoCollection.cs
- WebPartHeaderCloseVerb.cs
- BrowserDefinitionCollection.cs
- SettingsProviderCollection.cs
- SafeBitVector32.cs
- NullableIntAverageAggregationOperator.cs
- GenericTypeParameterConverter.cs
- RenderData.cs
- ItemDragEvent.cs
- BreakRecordTable.cs
- SecurityCapabilities.cs
- EventBuilder.cs
- XmlExtensionFunction.cs
- GridToolTip.cs