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
- HttpClientCredentialType.cs
- TraceLog.cs
- BuilderPropertyEntry.cs
- GPRECT.cs
- ParserOptions.cs
- PropertyConverter.cs
- StringCollectionEditor.cs
- WebPartConnection.cs
- TextElementEnumerator.cs
- RTLAwareMessageBox.cs
- QueueNameHelper.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- httpstaticobjectscollection.cs
- SubclassTypeValidator.cs
- CommonProperties.cs
- LambdaCompiler.Statements.cs
- CodeArrayIndexerExpression.cs
- Maps.cs
- PairComparer.cs
- ProcessModuleCollection.cs
- UIPropertyMetadata.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- InternalBase.cs
- ContractTypeNameElement.cs
- XmlAttributeCache.cs
- PersianCalendar.cs
- TypeUsageBuilder.cs
- FilterException.cs
- ProxyAttribute.cs
- QilGenerator.cs
- XamlBrushSerializer.cs
- WorkflowServiceBehavior.cs
- DeflateEmulationStream.cs
- InertiaTranslationBehavior.cs
- AttributeSetAction.cs
- BindingGroup.cs
- DelegateCompletionCallbackWrapper.cs
- OperationPickerDialog.designer.cs
- DependencyPropertyAttribute.cs
- Stopwatch.cs
- DescendentsWalkerBase.cs
- WindowsButton.cs
- ImmComposition.cs
- BinaryKeyIdentifierClause.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- Misc.cs
- SoapCodeExporter.cs
- Section.cs
- PassportIdentity.cs
- TextBoxAutoCompleteSourceConverter.cs
- EmbeddedMailObjectsCollection.cs
- XmlHelper.cs
- SqlXmlStorage.cs
- BitmapSource.cs
- ISO2022Encoding.cs
- TemplateColumn.cs
- GenericEnumConverter.cs
- SafePointer.cs
- PipeSecurity.cs
- GridView.cs
- UIElement3DAutomationPeer.cs
- MsmqDiagnostics.cs
- CapabilitiesState.cs
- SchemaImporter.cs
- _AutoWebProxyScriptWrapper.cs
- AuthenticateEventArgs.cs
- GenerateTemporaryTargetAssembly.cs
- EntityWithKeyStrategy.cs
- SplashScreen.cs
- ServiceContractListItemList.cs
- SqlDataSourceCommandEventArgs.cs
- IMembershipProvider.cs
- GeneralTransform3D.cs
- InputReport.cs
- XmlMtomReader.cs
- DispatcherFrame.cs
- MouseGestureValueSerializer.cs
- SequenceDesigner.cs
- CorruptingExceptionCommon.cs
- CalendarTable.cs
- OutgoingWebResponseContext.cs
- DrawingState.cs
- IPAddress.cs
- ParserOptions.cs
- ObjectTag.cs
- PersonalizationProviderHelper.cs
- BufferedGraphics.cs
- Wildcard.cs
- ProvidePropertyAttribute.cs
- HttpConfigurationSystem.cs
- WorkerRequest.cs
- XDRSchema.cs
- PropertyTab.cs
- CodeDirectoryCompiler.cs
- SQLSingleStorage.cs
- BitmapEncoder.cs
- Path.cs
- CodeMemberMethod.cs
- WebControlAdapter.cs
- SoapSchemaExporter.cs