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
- CatalogPart.cs
- SupportsEventValidationAttribute.cs
- ViewManager.cs
- BindingOperations.cs
- ActivationArguments.cs
- MouseEventArgs.cs
- SimpleBitVector32.cs
- LambdaExpression.cs
- Int16Animation.cs
- NonDualMessageSecurityOverHttpElement.cs
- InstancePersistence.cs
- PropertyChangedEventArgs.cs
- SyndicationDeserializer.cs
- CatalogZone.cs
- DataGridViewCellParsingEventArgs.cs
- OlePropertyStructs.cs
- SqlVisitor.cs
- Cursor.cs
- NumberAction.cs
- Hyperlink.cs
- DoubleKeyFrameCollection.cs
- SqlDataSourceEnumerator.cs
- Walker.cs
- FieldNameLookup.cs
- PageClientProxyGenerator.cs
- DtdParser.cs
- WSSecureConversationDec2005.cs
- ByteConverter.cs
- SymbolMethod.cs
- X509Utils.cs
- ListViewItem.cs
- basevalidator.cs
- ToolboxItemLoader.cs
- ServiceTimeoutsElement.cs
- RowToParametersTransformer.cs
- Soap.cs
- RoutedPropertyChangedEventArgs.cs
- HWStack.cs
- Size3DValueSerializer.cs
- safex509handles.cs
- DependsOnAttribute.cs
- ObjectViewQueryResultData.cs
- UidManager.cs
- WebScriptEnablingBehavior.cs
- DefaultBindingPropertyAttribute.cs
- SystemDropShadowChrome.cs
- GcSettings.cs
- ControlPropertyNameConverter.cs
- RadioButton.cs
- Message.cs
- PKCS1MaskGenerationMethod.cs
- Pkcs7Recipient.cs
- DataGridColumnCollectionEditor.cs
- GlobalEventManager.cs
- StreamGeometryContext.cs
- PackagePartCollection.cs
- SqlReorderer.cs
- DbConnectionClosed.cs
- XmlReaderSettings.cs
- TraceHelpers.cs
- sapiproxy.cs
- XAMLParseException.cs
- PropertyMetadata.cs
- UntypedNullExpression.cs
- HighlightVisual.cs
- TabControl.cs
- DiagnosticEventProvider.cs
- PageAdapter.cs
- EmptyCollection.cs
- QueryStringConverter.cs
- ItemTypeToolStripMenuItem.cs
- ClusterUtils.cs
- WindowsListViewSubItem.cs
- Shape.cs
- ReferenceService.cs
- CodeParameterDeclarationExpressionCollection.cs
- SoapConverter.cs
- NotImplementedException.cs
- SamlNameIdentifierClaimResource.cs
- Authorization.cs
- RequestStatusBarUpdateEventArgs.cs
- SqlExpressionNullability.cs
- CachedTypeface.cs
- CodeIdentifiers.cs
- GeneralTransform.cs
- ThrowHelper.cs
- HuffModule.cs
- MSAAWinEventWrap.cs
- DocumentViewerConstants.cs
- BitmapCodecInfoInternal.cs
- XhtmlBasicLiteralTextAdapter.cs
- COSERVERINFO.cs
- PropertyNames.cs
- DBSchemaTable.cs
- AbsoluteQuery.cs
- ErrorCodes.cs
- StateFinalizationDesigner.cs
- iisPickupDirectory.cs
- ProcessModelSection.cs
- TextServicesManager.cs