Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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); } } } // 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
- QueryExpr.cs
- FormViewUpdatedEventArgs.cs
- BitmapCodecInfoInternal.cs
- GifBitmapEncoder.cs
- WindowsTab.cs
- UIElementHelper.cs
- UriExt.cs
- Button.cs
- Int64Converter.cs
- FileVersion.cs
- CacheEntry.cs
- IntSumAggregationOperator.cs
- BoundField.cs
- SimplePropertyEntry.cs
- _ConnectOverlappedAsyncResult.cs
- MDIClient.cs
- UserInitiatedNavigationPermission.cs
- DependencyObject.cs
- WebPartDisplayModeEventArgs.cs
- KnowledgeBase.cs
- XmlNamespaceManager.cs
- ExecutionEngineException.cs
- ServiceModelConfigurationSectionCollection.cs
- ContainerUIElement3D.cs
- PlatformNotSupportedException.cs
- OptimisticConcurrencyException.cs
- AttachedAnnotation.cs
- followingquery.cs
- smtpconnection.cs
- ISessionStateStore.cs
- OdbcCommandBuilder.cs
- COAUTHIDENTITY.cs
- OutputCacheProfile.cs
- XmlBoundElement.cs
- BatchServiceHost.cs
- StylusCollection.cs
- LoginView.cs
- SecurityContext.cs
- BevelBitmapEffect.cs
- PkcsMisc.cs
- DataServicePagingProviderWrapper.cs
- EntityViewGenerationAttribute.cs
- Inflater.cs
- FontFamilyValueSerializer.cs
- BindingObserver.cs
- AssociativeAggregationOperator.cs
- SmiRecordBuffer.cs
- FilterQuery.cs
- VersionedStream.cs
- EventWaitHandle.cs
- TextContainer.cs
- DataObject.cs
- MemberHolder.cs
- WindowsListViewScroll.cs
- BaseProcessProtocolHandler.cs
- ConsoleEntryPoint.cs
- Socket.cs
- GraphicsState.cs
- FastEncoder.cs
- WebPartConnectionCollection.cs
- SqlProvider.cs
- WebPartRestoreVerb.cs
- ServiceHostingEnvironment.cs
- SkinBuilder.cs
- ViewStateModeByIdAttribute.cs
- NGCSerializationManager.cs
- FilteredAttributeCollection.cs
- ApplicationFileParser.cs
- _NativeSSPI.cs
- PeerName.cs
- XmlCharacterData.cs
- MimeMultiPart.cs
- GregorianCalendarHelper.cs
- InternalSafeNativeMethods.cs
- IISUnsafeMethods.cs
- MimeMultiPart.cs
- HScrollProperties.cs
- DataGridViewTopLeftHeaderCell.cs
- StreamResourceInfo.cs
- diagnosticsswitches.cs
- RealizedColumnsBlock.cs
- ItemContainerPattern.cs
- validation.cs
- CallbackHandler.cs
- WebPartVerb.cs
- MexHttpsBindingCollectionElement.cs
- SafeNativeMethods.cs
- XsdBuildProvider.cs
- Baml2006ReaderFrame.cs
- RectangleConverter.cs
- TTSEngineProxy.cs
- EmptyReadOnlyDictionaryInternal.cs
- SqlAggregateChecker.cs
- DispatcherExceptionFilterEventArgs.cs
- XmlDataLoader.cs
- ForceCopyBuildProvider.cs
- SystemException.cs
- TextEditorTyping.cs
- TimeSpanOrInfiniteValidator.cs
- DataSourceIDConverter.cs