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
- EndpointDispatcherTable.cs
- RawStylusInputCustomData.cs
- RelationshipEnd.cs
- FileDialogCustomPlace.cs
- QilInvokeEarlyBound.cs
- BaseTreeIterator.cs
- WindowsFormsHostPropertyMap.cs
- SqlProfileProvider.cs
- AtomEntry.cs
- SystemResourceKey.cs
- XPathMessageContext.cs
- DataBindingCollection.cs
- GridViewColumnCollection.cs
- PlainXmlWriter.cs
- WebBrowserNavigatingEventHandler.cs
- RouteParametersHelper.cs
- FieldBuilder.cs
- ReaderOutput.cs
- LogicalTreeHelper.cs
- PersonalizationStateQuery.cs
- SecurityPermission.cs
- DataGridTable.cs
- DocumentViewer.cs
- VScrollBar.cs
- Encoding.cs
- log.cs
- EpmCustomContentSerializer.cs
- mediaeventshelper.cs
- SpecialTypeDataContract.cs
- HMACSHA384.cs
- RegexRunnerFactory.cs
- GraphicsState.cs
- MembershipValidatePasswordEventArgs.cs
- ServerType.cs
- XmlTextAttribute.cs
- DBSchemaTable.cs
- HiddenField.cs
- HttpApplicationFactory.cs
- ViewSimplifier.cs
- RawStylusInputReport.cs
- PatternMatchRules.cs
- BuiltInPermissionSets.cs
- HtmlElementErrorEventArgs.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- WebBrowserNavigatedEventHandler.cs
- ProxyHelper.cs
- VisualStyleElement.cs
- TextRunCache.cs
- NetworkCredential.cs
- UpdateCommand.cs
- ObjectQuery_EntitySqlExtensions.cs
- ReaderOutput.cs
- LogWriteRestartAreaAsyncResult.cs
- TreeNodeStyle.cs
- ImageList.cs
- GZipDecoder.cs
- XPathNavigator.cs
- EntryWrittenEventArgs.cs
- LocatorPart.cs
- RegisteredExpandoAttribute.cs
- SelectedGridItemChangedEvent.cs
- GridPattern.cs
- PropertyBuilder.cs
- XmlIncludeAttribute.cs
- ClientScriptItemCollection.cs
- FilteredDataSetHelper.cs
- InterleavedZipPartStream.cs
- CreateUserWizardStep.cs
- SchemaNamespaceManager.cs
- GroupBoxRenderer.cs
- AsyncResult.cs
- OdbcInfoMessageEvent.cs
- ObjectQueryExecutionPlan.cs
- ScriptControlManager.cs
- TransformedBitmap.cs
- ServiceDocument.cs
- DataGridViewSelectedCellCollection.cs
- CaseInsensitiveHashCodeProvider.cs
- MaterialGroup.cs
- Typeface.cs
- DataTableReader.cs
- BaseDataList.cs
- WindowsSolidBrush.cs
- FilterElement.cs
- Vector3DConverter.cs
- CriticalExceptions.cs
- UnsafeNativeMethodsTablet.cs
- LoadedOrUnloadedOperation.cs
- BaseComponentEditor.cs
- DataGridViewColumnCollection.cs
- NetworkStream.cs
- SourceInterpreter.cs
- ToolStripStatusLabel.cs
- BrowserCapabilitiesFactory.cs
- SmuggledIUnknown.cs
- DataTableMappingCollection.cs
- DocumentAutomationPeer.cs
- sqlnorm.cs
- TextDecorationCollection.cs
- XPathSelectionIterator.cs