Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeFileHandle.cs / 1 / SafeFileHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileHandle ** ** ** 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; namespace Microsoft.Win32.SafeHandles { [SecurityPermission(SecurityAction.LinkDemand,UnmanagedCode=true)] public sealed class SafeFileHandle: SafeHandleZeroOrMinusOneIsInvalid { private SafeFileHandle() : base(true) { } public SafeFileHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) { SetHandle(preexistingHandle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return Win32Native.CloseHandle(handle); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataViewSettingCollection.cs
- ProgressBarRenderer.cs
- QilGeneratorEnv.cs
- TableAdapterManagerGenerator.cs
- DuplicateDetector.cs
- XmlQueryTypeFactory.cs
- TableLayoutPanelDesigner.cs
- ProfileEventArgs.cs
- TraceUtils.cs
- EncryptedPackage.cs
- SmiMetaData.cs
- JavaScriptObjectDeserializer.cs
- WindowsListView.cs
- HierarchicalDataTemplate.cs
- _IPv4Address.cs
- securitycriticaldataformultiplegetandset.cs
- brushes.cs
- MenuCommands.cs
- WmlObjectListAdapter.cs
- XPathEmptyIterator.cs
- WebPartCancelEventArgs.cs
- ControlValuePropertyAttribute.cs
- DecimalAnimationUsingKeyFrames.cs
- JobPageOrder.cs
- thaishape.cs
- EventHandlerService.cs
- Simplifier.cs
- FontInfo.cs
- AndMessageFilter.cs
- Visitors.cs
- GZipStream.cs
- DataSourceExpressionCollection.cs
- RecognizerBase.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- AssemblyResolver.cs
- Control.cs
- ClassData.cs
- NetStream.cs
- TextParagraphCache.cs
- RouteValueExpressionBuilder.cs
- VectorKeyFrameCollection.cs
- BrowserDefinitionCollection.cs
- SubMenuStyle.cs
- CompilerHelpers.cs
- Clipboard.cs
- XmlSyndicationContent.cs
- WebHttpEndpointElement.cs
- Dictionary.cs
- XPathDocumentNavigator.cs
- DataGridComponentEditor.cs
- InsufficientMemoryException.cs
- DocumentAutomationPeer.cs
- InvokeGenerator.cs
- XamlHostingConfiguration.cs
- Control.cs
- RegexFCD.cs
- NavigationEventArgs.cs
- PlaceHolder.cs
- ServerIdentity.cs
- PropertyTab.cs
- SchemaComplexType.cs
- DataColumnPropertyDescriptor.cs
- TimeSpanHelper.cs
- ListBase.cs
- SiteMapProvider.cs
- TimeStampChecker.cs
- PolicyManager.cs
- SqlCrossApplyToCrossJoin.cs
- OleDbConnection.cs
- PropertySegmentSerializer.cs
- ZipIOExtraFieldZip64Element.cs
- Version.cs
- Sql8ConformanceChecker.cs
- SocketElement.cs
- SqlDataRecord.cs
- UdpTransportSettingsElement.cs
- PathFigure.cs
- KeyInfo.cs
- FocusManager.cs
- FontFaceLayoutInfo.cs
- GenericArgumentsUpdater.cs
- DecoderReplacementFallback.cs
- CloudCollection.cs
- Root.cs
- SelectionRange.cs
- SafeFileHandle.cs
- BinaryNode.cs
- DataSourceXmlSerializationAttribute.cs
- X509Utils.cs
- VisualTreeHelper.cs
- ItemsPresenter.cs
- InteropDesigner.xaml.cs
- DeclarationUpdate.cs
- SimpleHandlerBuildProvider.cs
- ResponseBodyWriter.cs
- QueryAsyncResult.cs
- DbProviderSpecificTypePropertyAttribute.cs
- mediaeventshelper.cs
- SectionVisual.cs
- SendMailErrorEventArgs.cs