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
- StringDictionaryCodeDomSerializer.cs
- HtmlDocument.cs
- CredentialCache.cs
- DiscoveryService.cs
- BackgroundWorker.cs
- StringDictionary.cs
- LockedAssemblyCache.cs
- MetadataArtifactLoaderFile.cs
- WebScriptServiceHost.cs
- TemplateKeyConverter.cs
- ZoneIdentityPermission.cs
- SelectedDatesCollection.cs
- ZipIOExtraFieldZip64Element.cs
- CatchBlock.cs
- ConfigXmlSignificantWhitespace.cs
- TreeViewAutomationPeer.cs
- EmptyImpersonationContext.cs
- EncryptedKeyIdentifierClause.cs
- PrintControllerWithStatusDialog.cs
- Brush.cs
- CodeGenerator.cs
- ArraySegment.cs
- ConfigDefinitionUpdates.cs
- InternalUserCancelledException.cs
- SecurityTimestamp.cs
- ColorAnimationBase.cs
- BevelBitmapEffect.cs
- WindowsHyperlink.cs
- Keywords.cs
- SecureConversationServiceElement.cs
- RepeaterItem.cs
- ApplicationBuildProvider.cs
- DataGridViewUtilities.cs
- DataBoundControlHelper.cs
- LineBreakRecord.cs
- GeneralTransform3DTo2DTo3D.cs
- Package.cs
- KnownIds.cs
- ellipse.cs
- DataGridClipboardHelper.cs
- TextTreeUndoUnit.cs
- DataGridColumnHeaderAutomationPeer.cs
- SelectionEditor.cs
- WebPartCancelEventArgs.cs
- GlobalAllocSafeHandle.cs
- DesignerPerfEventProvider.cs
- DebugTraceHelper.cs
- SessionPageStateSection.cs
- TypeTypeConverter.cs
- UrlMappingsSection.cs
- ErrorWrapper.cs
- ModelVisual3D.cs
- OrthographicCamera.cs
- RootBuilder.cs
- DataGridColumnDropSeparator.cs
- FixedPageStructure.cs
- SelectionGlyph.cs
- HtmlValidationSummaryAdapter.cs
- LineProperties.cs
- DataGridViewCellEventArgs.cs
- EpmContentSerializerBase.cs
- OracleBinary.cs
- BindingWorker.cs
- XsltConvert.cs
- BitConverter.cs
- DataServiceSaveChangesEventArgs.cs
- FileSystemWatcher.cs
- InternalTypeHelper.cs
- ZipIOBlockManager.cs
- ValueSerializerAttribute.cs
- WindowsNonControl.cs
- SafeSecurityHandles.cs
- StreamFormatter.cs
- EncoderReplacementFallback.cs
- LogStream.cs
- DataService.cs
- StructuredTypeInfo.cs
- ProjectedSlot.cs
- StringUtil.cs
- TemplateControlParser.cs
- MessageAction.cs
- QilCloneVisitor.cs
- ContentControl.cs
- MatrixConverter.cs
- AudioSignalProblemOccurredEventArgs.cs
- SmiEventStream.cs
- Light.cs
- ThreadInterruptedException.cs
- CqlGenerator.cs
- ProfileBuildProvider.cs
- VisualStyleInformation.cs
- IOException.cs
- ItemsChangedEventArgs.cs
- TrustManagerPromptUI.cs
- PropertyCollection.cs
- CodeDomSerializationProvider.cs
- LinqDataSource.cs
- BitConverter.cs
- EmptyStringExpandableObjectConverter.cs
- DataGrid.cs