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
- ComContractElement.cs
- RepeaterItemCollection.cs
- DESCryptoServiceProvider.cs
- CommandBindingCollection.cs
- ConstantProjectedSlot.cs
- ProgressPage.cs
- BamlResourceDeserializer.cs
- LambdaCompiler.Statements.cs
- OpenTypeLayoutCache.cs
- StorageInfo.cs
- RemotingConfiguration.cs
- XmlProcessingInstruction.cs
- DataObjectAttribute.cs
- RootNamespaceAttribute.cs
- PerformanceCounter.cs
- Exception.cs
- Preprocessor.cs
- StoreItemCollection.Loader.cs
- RelationshipType.cs
- ConfigurationValidatorAttribute.cs
- BoundColumn.cs
- ListViewGroup.cs
- MenuItemCollection.cs
- HttpCapabilitiesSectionHandler.cs
- ErrorHandler.cs
- TableColumnCollection.cs
- ListBindingHelper.cs
- SharedPerformanceCounter.cs
- CompilerCollection.cs
- ASCIIEncoding.cs
- DbDataSourceEnumerator.cs
- StrokeRenderer.cs
- ThreadExceptionDialog.cs
- COM2ExtendedBrowsingHandler.cs
- DropAnimation.xaml.cs
- RemotingSurrogateSelector.cs
- TableCell.cs
- ControlTemplate.cs
- AssemblyBuilderData.cs
- Completion.cs
- HostingEnvironmentException.cs
- CorrelationValidator.cs
- MembershipUser.cs
- WebConfigurationHostFileChange.cs
- FlowchartDesignerCommands.cs
- OleDbTransaction.cs
- SqlIdentifier.cs
- FieldMetadata.cs
- ErrorStyle.cs
- XsltSettings.cs
- NotFiniteNumberException.cs
- StrongNamePublicKeyBlob.cs
- Vector3D.cs
- StateDesigner.Helpers.cs
- DataGridViewUtilities.cs
- ArgumentsParser.cs
- ContextInformation.cs
- EventManager.cs
- TextRangeProviderWrapper.cs
- NullableIntMinMaxAggregationOperator.cs
- ParameterModifier.cs
- _TimerThread.cs
- Roles.cs
- OdbcReferenceCollection.cs
- StructuredTypeInfo.cs
- StringAnimationUsingKeyFrames.cs
- PropertySegmentSerializer.cs
- XmlIlVisitor.cs
- TemplateApplicationHelper.cs
- RealizationContext.cs
- FormatterServices.cs
- WsdlInspector.cs
- QilIterator.cs
- CommonObjectSecurity.cs
- ArgumentOutOfRangeException.cs
- LayoutTableCell.cs
- ExceptionHandlers.cs
- SystemTcpConnection.cs
- DispatcherSynchronizationContext.cs
- FontFamily.cs
- DataSetMappper.cs
- FocusWithinProperty.cs
- DataGridRowEventArgs.cs
- StreamInfo.cs
- EntityType.cs
- PkcsMisc.cs
- NavigationProgressEventArgs.cs
- basenumberconverter.cs
- HebrewNumber.cs
- ByteAnimationBase.cs
- ListItemsPage.cs
- MetadataItemEmitter.cs
- LinqDataSourceSelectEventArgs.cs
- DefaultAsyncDataDispatcher.cs
- VSWCFServiceContractGenerator.cs
- HtmlEncodedRawTextWriter.cs
- LinkUtilities.cs
- TreeViewBindingsEditor.cs
- CacheChildrenQuery.cs
- SessionState.cs