Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- QueryAccessibilityHelpEvent.cs
- CompilerGeneratedAttribute.cs
- WizardStepBase.cs
- MailDefinition.cs
- PersonalizationProviderHelper.cs
- basenumberconverter.cs
- WebBrowserProgressChangedEventHandler.cs
- UrlPath.cs
- TimerElapsedEvenArgs.cs
- PrintController.cs
- HttpCookieCollection.cs
- Expr.cs
- EdmItemError.cs
- XmlSchemaDocumentation.cs
- HwndMouseInputProvider.cs
- XmlSchemaInclude.cs
- AdjustableArrowCap.cs
- EllipseGeometry.cs
- SchemaComplexType.cs
- ThicknessConverter.cs
- DBPropSet.cs
- MouseActionValueSerializer.cs
- _ListenerRequestStream.cs
- ComboBoxItem.cs
- RuntimeHandles.cs
- DefaultHttpHandler.cs
- ToolStripRendererSwitcher.cs
- RootNamespaceAttribute.cs
- DescendantBaseQuery.cs
- SmiEventStream.cs
- ImageEditor.cs
- DateTimeOffset.cs
- InvocationExpression.cs
- ThicknessAnimationUsingKeyFrames.cs
- SqlDataSource.cs
- OracleBFile.cs
- EventDriven.cs
- UpdateCompiler.cs
- ToolStripLabel.cs
- ListViewItemSelectionChangedEvent.cs
- EnterpriseServicesHelper.cs
- Math.cs
- OlePropertyStructs.cs
- FieldAccessException.cs
- CanonicalizationDriver.cs
- XmlException.cs
- WorkflowApplicationUnloadedException.cs
- precedingquery.cs
- EventLogPermission.cs
- ParameterCollection.cs
- OleServicesContext.cs
- AssemblyBuilder.cs
- Pen.cs
- CatalogZone.cs
- QilNode.cs
- CacheRequest.cs
- ProgressBarRenderer.cs
- DataGridViewColumn.cs
- Expression.cs
- BamlTreeNode.cs
- WindowsNonControl.cs
- MediaPlayerState.cs
- CodeEventReferenceExpression.cs
- ScrollChrome.cs
- SocketPermission.cs
- ButtonChrome.cs
- TextParentUndoUnit.cs
- RMEnrollmentPage3.cs
- BuildResultCache.cs
- TypedTableBase.cs
- SrgsElementList.cs
- dsa.cs
- ExpressionLink.cs
- x509store.cs
- RectAnimationBase.cs
- KeyConverter.cs
- MetadataPropertyvalue.cs
- MediaContextNotificationWindow.cs
- TraceShell.cs
- CodeAttributeArgumentCollection.cs
- XmlSchemaImport.cs
- ReflectEventDescriptor.cs
- NativeMethods.cs
- sqlmetadatafactory.cs
- DBAsyncResult.cs
- RegularExpressionValidator.cs
- InfoCardHelper.cs
- ImpersonateTokenRef.cs
- SoapInteropTypes.cs
- RowUpdatingEventArgs.cs
- UrlMappingCollection.cs
- StreamInfo.cs
- ApplicationGesture.cs
- PageVisual.cs
- HighlightComponent.cs
- LocatorPartList.cs
- XhtmlBasicValidationSummaryAdapter.cs
- WorkflowInspectionServices.cs
- NullableIntMinMaxAggregationOperator.cs
- DesignerTransactionCloseEvent.cs