Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FrameworkContextData.cs
- MemoryMappedFile.cs
- SymbolTable.cs
- FloaterParaClient.cs
- MsmqAppDomainProtocolHandler.cs
- RowToParametersTransformer.cs
- ReferenceAssemblyAttribute.cs
- PackUriHelper.cs
- MarkupCompilePass2.cs
- CapabilitiesState.cs
- SafeLocalMemHandle.cs
- DesignerDataTable.cs
- RtfToXamlLexer.cs
- WindowInteropHelper.cs
- XPathDocumentIterator.cs
- SmiEventSink_DeferedProcessing.cs
- GenerateTemporaryTargetAssembly.cs
- XmlTextAttribute.cs
- LogStore.cs
- XmlIlVisitor.cs
- RecordsAffectedEventArgs.cs
- invalidudtexception.cs
- ResourceExpressionBuilder.cs
- ResetableIterator.cs
- InvokeSchedule.cs
- DelegateArgumentReference.cs
- NavigatorInput.cs
- BamlLocalizer.cs
- GridToolTip.cs
- SmiEventSink_DeferedProcessing.cs
- XmlNamespaceDeclarationsAttribute.cs
- EtwTrace.cs
- SimpleApplicationHost.cs
- precedingsibling.cs
- InvalidCastException.cs
- PrintController.cs
- XmlQueryRuntime.cs
- WebPartManagerDesigner.cs
- Int32EqualityComparer.cs
- DateTimeStorage.cs
- DropShadowBitmapEffect.cs
- DataPagerFieldItem.cs
- Transform.cs
- MessageBox.cs
- HostAdapter.cs
- Config.cs
- SqlResolver.cs
- CommandValueSerializer.cs
- Mouse.cs
- X509UI.cs
- StandardTransformFactory.cs
- UrlPropertyAttribute.cs
- Menu.cs
- ResourceExpression.cs
- Crc32.cs
- HelloMessage11.cs
- SqlBulkCopy.cs
- PrinterSettings.cs
- OdbcConnectionHandle.cs
- ConnectionProviderAttribute.cs
- PeerInputChannelListener.cs
- FragmentQueryProcessor.cs
- TextEffect.cs
- SHA384Managed.cs
- MemoryMappedView.cs
- DataControlButton.cs
- ElementUtil.cs
- DataServiceQuery.cs
- TimeSpanConverter.cs
- Geometry.cs
- DbMetaDataColumnNames.cs
- IisTraceListener.cs
- CodeCommentStatement.cs
- HtmlTableRow.cs
- StateRuntime.cs
- TypeUsage.cs
- TimelineClockCollection.cs
- OperationResponse.cs
- ITextView.cs
- XPathPatternBuilder.cs
- EpmContentSerializerBase.cs
- IndexingContentUnit.cs
- StrokeRenderer.cs
- SafeNativeMethods.cs
- DrawingAttributesDefaultValueFactory.cs
- AdornerPresentationContext.cs
- SystemGatewayIPAddressInformation.cs
- XmlTextReader.cs
- RequiredFieldValidator.cs
- prefixendpointaddressmessagefiltertable.cs
- ItemDragEvent.cs
- PartialToken.cs
- TrustSection.cs
- DelayedRegex.cs
- RuntimeResourceSet.cs
- NonceToken.cs
- TextRunProperties.cs
- ComponentEditorPage.cs
- AccessedThroughPropertyAttribute.cs
- MetadataProperty.cs