Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeViewOfFileHandle.cs / 1 / SafeViewOfFileHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeViewOfFileHandle ** ** ** A wrapper for file handles ** ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeViewOfFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeViewOfFileHandle() : base(true) {} // 0 is an Invalid Handle [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeViewOfFileHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { if (Win32Native.UnmapViewOfFile(handle)) { handle = IntPtr.Zero; return true; } return false; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- httpstaticobjectscollection.cs
- TransactionScopeDesigner.cs
- TypeConstant.cs
- OleDbDataReader.cs
- BooleanConverter.cs
- SchemaRegistration.cs
- AssociationSetEnd.cs
- ContainerSelectorActiveEvent.cs
- DBNull.cs
- ToolStripSystemRenderer.cs
- TreeViewItemAutomationPeer.cs
- MetadataCacheItem.cs
- PeerApplication.cs
- PrintDialog.cs
- XmlSchemaProviderAttribute.cs
- COM2Enum.cs
- SelectionEditor.cs
- GlobalProxySelection.cs
- ByteConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- URLAttribute.cs
- SqlPersonalizationProvider.cs
- HwndSourceKeyboardInputSite.cs
- SudsWriter.cs
- Condition.cs
- XPathDocumentBuilder.cs
- ObjectDataSourceDisposingEventArgs.cs
- CorrelationKeyCalculator.cs
- CharacterShapingProperties.cs
- DataKey.cs
- FormClosedEvent.cs
- Parameter.cs
- NotImplementedException.cs
- DefaultEvaluationContext.cs
- PerspectiveCamera.cs
- Message.cs
- ExternalException.cs
- MaxValueConverter.cs
- ComplexPropertyEntry.cs
- WebServiceParameterData.cs
- ClientUrlResolverWrapper.cs
- CompilerInfo.cs
- TextDecorationLocationValidation.cs
- HttpListenerPrefixCollection.cs
- FontWeights.cs
- ToolStripDropDownMenu.cs
- PenThreadPool.cs
- BinaryNode.cs
- EdmConstants.cs
- NegationPusher.cs
- EffectiveValueEntry.cs
- MsmqIntegrationSecurityElement.cs
- Style.cs
- RegionInfo.cs
- InputScopeAttribute.cs
- TargetConverter.cs
- HttpConfigurationSystem.cs
- SchemaElement.cs
- RootDesignerSerializerAttribute.cs
- ContextConfiguration.cs
- XmlSchemaExporter.cs
- EntityDesignerUtils.cs
- ImageAnimator.cs
- ElementProxy.cs
- EncryptedKey.cs
- EncryptedPackageFilter.cs
- LicenseException.cs
- WmpBitmapDecoder.cs
- BinaryUtilClasses.cs
- OpenFileDialog.cs
- FileDetails.cs
- ParsedRoute.cs
- NamespaceTable.cs
- DataGridViewDataConnection.cs
- Variable.cs
- Transform.cs
- DelayLoadType.cs
- QuaternionRotation3D.cs
- ResourceManagerWrapper.cs
- followingquery.cs
- ImageMetadata.cs
- TracePayload.cs
- MergablePropertyAttribute.cs
- Token.cs
- LabelAutomationPeer.cs
- TableAdapterManagerNameHandler.cs
- Event.cs
- ArrayElementGridEntry.cs
- webbrowsersite.cs
- ListDesigner.cs
- ObjectNotFoundException.cs
- Identity.cs
- UInt16Storage.cs
- XmlSchemaExternal.cs
- GroupByExpressionRewriter.cs
- PrePrepareMethodAttribute.cs
- RelationshipType.cs
- PageAsyncTaskManager.cs
- QuestionEventArgs.cs
- VectorCollection.cs