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
- SignedXml.cs
- DataProtection.cs
- XmlSchemaSet.cs
- AuthorizationPolicyTypeElementCollection.cs
- WorkflowRuntimeServiceElement.cs
- DynamicScriptObject.cs
- NetworkCredential.cs
- GenericTypeParameterConverter.cs
- WebPartHeaderCloseVerb.cs
- ConfigurationConverterBase.cs
- XmlEncoding.cs
- HashCodeCombiner.cs
- ArrayList.cs
- BitmapCache.cs
- DLinqColumnProvider.cs
- SupportedAddressingMode.cs
- CompensationToken.cs
- SqlNotificationEventArgs.cs
- ErrorFormatter.cs
- ParsedRoute.cs
- OdbcStatementHandle.cs
- Compress.cs
- ToolStripLocationCancelEventArgs.cs
- NavigationProgressEventArgs.cs
- XamlPointCollectionSerializer.cs
- ServicePointManager.cs
- ModelTypeConverter.cs
- BasePattern.cs
- ChangeProcessor.cs
- TextServicesPropertyRanges.cs
- WindowsSysHeader.cs
- DBConnection.cs
- CharUnicodeInfo.cs
- AutoResetEvent.cs
- UtilityExtension.cs
- KeyFrames.cs
- QueryOptionExpression.cs
- DataGridItemAutomationPeer.cs
- SymmetricAlgorithm.cs
- BindingOperations.cs
- SessionStateSection.cs
- ErrorHandlingAcceptor.cs
- TextTabProperties.cs
- CatalogPartCollection.cs
- Trace.cs
- VerticalAlignConverter.cs
- XmlSchemas.cs
- SelectionRange.cs
- CollectionViewGroupRoot.cs
- _OSSOCK.cs
- Delegate.cs
- URIFormatException.cs
- DataControlLinkButton.cs
- CodeIdentifiers.cs
- XmlStrings.cs
- DynamicQueryableWrapper.cs
- MetadataProperty.cs
- SafeNativeMethods.cs
- DateTimeValueSerializerContext.cs
- FileLoadException.cs
- WebPartEditVerb.cs
- StrongTypingException.cs
- _ConnectOverlappedAsyncResult.cs
- CellConstantDomain.cs
- GAC.cs
- XmlValidatingReader.cs
- HotSpotCollection.cs
- storepermissionattribute.cs
- TextBox.cs
- ResXResourceReader.cs
- DomNameTable.cs
- XhtmlTextWriter.cs
- MemberInfoSerializationHolder.cs
- TextBoxAutomationPeer.cs
- ResourcePermissionBaseEntry.cs
- propertytag.cs
- VisualTarget.cs
- autovalidator.cs
- VisualTreeHelper.cs
- DictionaryManager.cs
- FileUtil.cs
- GlobalDataBindingHandler.cs
- ItemMap.cs
- ToolStripPanelCell.cs
- XmlEncodedRawTextWriter.cs
- SQLRoleProvider.cs
- CatalogZoneAutoFormat.cs
- CollectionConverter.cs
- XmlAnyElementAttributes.cs
- FastPropertyAccessor.cs
- EmissiveMaterial.cs
- CapacityStreamGeometryContext.cs
- IntPtr.cs
- Emitter.cs
- WsatServiceCertificate.cs
- IMembershipProvider.cs
- TextEndOfParagraph.cs
- BufferBuilder.cs
- ChannelSettingsElement.cs
- Tablet.cs