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
- XmlAtomicValue.cs
- IntSumAggregationOperator.cs
- RecipientInfo.cs
- SqlDataSourceView.cs
- MatchAttribute.cs
- WorkflowServiceNamespace.cs
- ProcessThreadDesigner.cs
- DataBoundLiteralControl.cs
- PersonalizationStateQuery.cs
- PointHitTestParameters.cs
- HtmlShim.cs
- InternalTransaction.cs
- SudsCommon.cs
- SimpleRecyclingCache.cs
- Attribute.cs
- DbModificationClause.cs
- RijndaelManaged.cs
- Misc.cs
- SqlParameterizer.cs
- InvokeWebServiceDesigner.cs
- COM2Properties.cs
- TreeChangeInfo.cs
- WebPartManager.cs
- HwndSubclass.cs
- DefaultWorkflowLoaderService.cs
- _NetworkingPerfCounters.cs
- WindowsTooltip.cs
- CardSpaceSelector.cs
- WebPartEditorApplyVerb.cs
- CriticalHandle.cs
- UnsafeNativeMethods.cs
- BindingMemberInfo.cs
- WebPartManagerInternals.cs
- SqlHelper.cs
- StringResourceManager.cs
- Exceptions.cs
- DataSourceExpressionCollection.cs
- NativeMethods.cs
- DataObjectAttribute.cs
- NamespaceDecl.cs
- DesignerProperties.cs
- QilBinary.cs
- _emptywebproxy.cs
- XamlPathDataSerializer.cs
- WinEventWrap.cs
- linebase.cs
- XPathDocument.cs
- PagedControl.cs
- FormViewInsertedEventArgs.cs
- CategoryAttribute.cs
- BulletDecorator.cs
- ObjectQueryProvider.cs
- VerificationException.cs
- TextServicesLoader.cs
- WaitHandle.cs
- XmlJsonWriter.cs
- TypeHelper.cs
- ExceptionHandlersDesigner.cs
- UserNameSecurityTokenAuthenticator.cs
- SecUtil.cs
- ModelUIElement3D.cs
- ToolBarOverflowPanel.cs
- FileLogRecord.cs
- MarkupExtensionReturnTypeAttribute.cs
- ErrorsHelper.cs
- ReadOnlyDataSourceView.cs
- ColumnHeader.cs
- BeginStoryboard.cs
- DiagnosticsConfigurationHandler.cs
- NestedContainer.cs
- StatusBar.cs
- Inflater.cs
- Adorner.cs
- DbXmlEnabledProviderManifest.cs
- CommandValueSerializer.cs
- RoleManagerModule.cs
- sqlcontext.cs
- SystemWebCachingSectionGroup.cs
- ApplicationServicesHostFactory.cs
- TypeToken.cs
- MimeMapping.cs
- SqlMetaData.cs
- EventHandlersDesigner.cs
- GrammarBuilderRuleRef.cs
- HelpExampleGenerator.cs
- ConfigXmlComment.cs
- TextPenaltyModule.cs
- XPathSingletonIterator.cs
- safesecurityhelperavalon.cs
- Resources.Designer.cs
- Trace.cs
- metadatamappinghashervisitor.cs
- WindowVisualStateTracker.cs
- CookieHandler.cs
- PointCollectionValueSerializer.cs
- RayHitTestParameters.cs
- RelatedPropertyManager.cs
- oledbmetadatacolumnnames.cs
- parserscommon.cs
- ProcessModuleCollection.cs