Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ImpersonateTokenRef.cs / 1305376 / ImpersonateTokenRef.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Web.Util; using System.Web.Configuration; // class IdentitySection internal sealed class ImpersonateTokenRef : IDisposable { private IntPtr _handle; internal ImpersonateTokenRef(IntPtr token) { _handle = token; } internal IntPtr Handle { get { return _handle; } } // The handle can be kept alive by HttpContext.s_appIdentityConfig (see ASURT#121815) ~ImpersonateTokenRef() { if (_handle != IntPtr.Zero) { UnsafeNativeMethods.CloseHandle(_handle); _handle = IntPtr.Zero; } } void IDisposable.Dispose() { if (_handle != IntPtr.Zero) { UnsafeNativeMethods.CloseHandle(_handle); _handle = IntPtr.Zero; } GC.SuppressFinalize(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; using System.Web.Util; using System.Web.Configuration; // class IdentitySection internal sealed class ImpersonateTokenRef : IDisposable { private IntPtr _handle; internal ImpersonateTokenRef(IntPtr token) { _handle = token; } internal IntPtr Handle { get { return _handle; } } // The handle can be kept alive by HttpContext.s_appIdentityConfig (see ASURT#121815) ~ImpersonateTokenRef() { if (_handle != IntPtr.Zero) { UnsafeNativeMethods.CloseHandle(_handle); _handle = IntPtr.Zero; } } void IDisposable.Dispose() { if (_handle != IntPtr.Zero) { UnsafeNativeMethods.CloseHandle(_handle); _handle = IntPtr.Zero; } GC.SuppressFinalize(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Trace.cs
- BamlWriter.cs
- PropertyRecord.cs
- ApplicationException.cs
- VirtualPath.cs
- UidPropertyAttribute.cs
- XmlComplianceUtil.cs
- SQLByte.cs
- FlowDocumentReaderAutomationPeer.cs
- RtfControls.cs
- ManualResetEventSlim.cs
- IgnoreDeviceFilterElement.cs
- OleDbCommandBuilder.cs
- ObjectPersistData.cs
- AbsoluteQuery.cs
- ObjectComplexPropertyMapping.cs
- XmlNode.cs
- DataGridViewElement.cs
- Variant.cs
- XPathExpr.cs
- AttributeProviderAttribute.cs
- PathData.cs
- SoapReflectionImporter.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- XmlIlVisitor.cs
- ListDataHelper.cs
- SoapAttributeAttribute.cs
- CallSiteBinder.cs
- PackageRelationshipSelector.cs
- CultureInfoConverter.cs
- BamlReader.cs
- hebrewshape.cs
- DelegatingTypeDescriptionProvider.cs
- _DisconnectOverlappedAsyncResult.cs
- MatrixTransform.cs
- XmlSerializer.cs
- MessageSmuggler.cs
- CodeBlockBuilder.cs
- OpenTypeCommon.cs
- SmtpException.cs
- NamedPermissionSet.cs
- NavigationHelper.cs
- DiscoveryClientElement.cs
- EastAsianLunisolarCalendar.cs
- ManualResetEvent.cs
- EntityConnectionStringBuilder.cs
- MenuItemAutomationPeer.cs
- ObjectConverter.cs
- LoginNameDesigner.cs
- InstanceStore.cs
- CodeTypeDeclaration.cs
- TakeQueryOptionExpression.cs
- AssemblyInfo.cs
- MembershipSection.cs
- BindStream.cs
- COAUTHINFO.cs
- Comparer.cs
- BaseTreeIterator.cs
- XmlStreamStore.cs
- RightsManagementPermission.cs
- WebPartTransformer.cs
- NotImplementedException.cs
- DataGridViewCell.cs
- DataMisalignedException.cs
- PassportAuthenticationEventArgs.cs
- GeneralTransform3DTo2DTo3D.cs
- LicenseProviderAttribute.cs
- BitmapFrame.cs
- BuildProvider.cs
- FilteredDataSetHelper.cs
- PageSettings.cs
- WindowsIdentity.cs
- StringConcat.cs
- FontFamilyIdentifier.cs
- TypefaceCollection.cs
- WebPartConnectionsCloseVerb.cs
- XmlEncoding.cs
- FormatControl.cs
- VersionPair.cs
- ServiceMemoryGates.cs
- TagNameToTypeMapper.cs
- DefaultAsyncDataDispatcher.cs
- MultiAsyncResult.cs
- HashAlgorithm.cs
- MergePropertyDescriptor.cs
- RolePrincipal.cs
- MarkupCompilePass1.cs
- ObjectPersistData.cs
- objectquery_tresulttype.cs
- TextOptionsInternal.cs
- PatternMatcher.cs
- EntityPropertyMappingAttribute.cs
- ParseHttpDate.cs
- Thumb.cs
- ErrorStyle.cs
- SimpleApplicationHost.cs
- AuthenticationManager.cs
- DataGridPreparingCellForEditEventArgs.cs
- CategoryNameCollection.cs
- DataGridBoolColumn.cs