Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AnnotationHighlightLayer.cs
- RemotingConfigParser.cs
- GridViewPageEventArgs.cs
- Geometry3D.cs
- UTF32Encoding.cs
- Rijndael.cs
- PnrpPermission.cs
- MimeMultiPart.cs
- TextControl.cs
- InstallerTypeAttribute.cs
- XsdDuration.cs
- CodeDomSerializerException.cs
- EncoderExceptionFallback.cs
- RemotingSurrogateSelector.cs
- HttpApplication.cs
- EventLogPermissionEntryCollection.cs
- TemplateBaseAction.cs
- PathFigureCollectionConverter.cs
- SQLUtility.cs
- SequenceFullException.cs
- CertificateManager.cs
- FileSystemEventArgs.cs
- EntityDesignerUtils.cs
- HtmlTextViewAdapter.cs
- CompressEmulationStream.cs
- FontWeightConverter.cs
- ContainerTracking.cs
- SecureStringHasher.cs
- AuthenticationException.cs
- ClientSideProviderDescription.cs
- ActivationServices.cs
- AspNetSynchronizationContext.cs
- ProcessHostFactoryHelper.cs
- XPathNodeList.cs
- ProcessHostFactoryHelper.cs
- ListBoxAutomationPeer.cs
- CodeMemberProperty.cs
- mediaeventargs.cs
- VisualBrush.cs
- Choices.cs
- PersistChildrenAttribute.cs
- DataGridCell.cs
- ApplicationTrust.cs
- CheckBoxList.cs
- Journaling.cs
- ContractNamespaceAttribute.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- EntityCollection.cs
- CorrelationToken.cs
- AdornerDecorator.cs
- XmlCharCheckingWriter.cs
- ParenthesizePropertyNameAttribute.cs
- ClassHandlersStore.cs
- BinarySerializer.cs
- DesignerHost.cs
- CodeSnippetStatement.cs
- CursorEditor.cs
- XmlSchemaComplexContentExtension.cs
- XPathQilFactory.cs
- Attributes.cs
- MsmqPoisonMessageException.cs
- FileNameEditor.cs
- AlphabetConverter.cs
- X509Utils.cs
- AutomationIdentifierGuids.cs
- _UriSyntax.cs
- IDReferencePropertyAttribute.cs
- SourceInterpreter.cs
- TextFragmentEngine.cs
- OracleParameterBinding.cs
- InstallerTypeAttribute.cs
- LicenseManager.cs
- TableHeaderCell.cs
- SqlResolver.cs
- SvcMapFileSerializer.cs
- FunctionImportElement.cs
- Clock.cs
- ImageSource.cs
- IChannel.cs
- MasterPage.cs
- NamedServiceModelExtensionCollectionElement.cs
- RelationshipEndCollection.cs
- TemplateKey.cs
- DrawingServices.cs
- LogicalTreeHelper.cs
- LoginView.cs
- OpenTypeMethods.cs
- FacetChecker.cs
- ValueUnavailableException.cs
- webbrowsersite.cs
- TypeConverterAttribute.cs
- InstanceOwnerException.cs
- ValidationErrorInfo.cs
- Content.cs
- XPathDocumentBuilder.cs
- AlternationConverter.cs
- StoreItemCollection.Loader.cs
- TransformationRules.cs
- DataGridColumnCollection.cs
- DataKeyArray.cs