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
- AuthorizationRule.cs
- AssemblyFilter.cs
- FileNotFoundException.cs
- QueryResult.cs
- AnonymousIdentificationSection.cs
- MouseDevice.cs
- LookupTables.cs
- TreeViewItemAutomationPeer.cs
- HtmlCommandAdapter.cs
- SafeFileMappingHandle.cs
- RSAProtectedConfigurationProvider.cs
- BulletedListEventArgs.cs
- RedistVersionInfo.cs
- XPathChildIterator.cs
- LayoutEngine.cs
- FaultReasonText.cs
- Int32.cs
- ToolStripSplitButton.cs
- DependencyProperty.cs
- WebPartZone.cs
- TransactionCache.cs
- HttpModulesSection.cs
- GroupItem.cs
- __TransparentProxy.cs
- CommandLineParser.cs
- EntityDataSourceUtil.cs
- URI.cs
- ExpressionEvaluator.cs
- Roles.cs
- CuspData.cs
- HtmlInputHidden.cs
- EnumUnknown.cs
- regiisutil.cs
- DockAndAnchorLayout.cs
- EndPoint.cs
- PartBasedPackageProperties.cs
- coordinator.cs
- NoClickablePointException.cs
- XPathNodePointer.cs
- ADConnectionHelper.cs
- GZipDecoder.cs
- BaseComponentEditor.cs
- SoapCodeExporter.cs
- SecurityState.cs
- COAUTHINFO.cs
- XamlClipboardData.cs
- DataStorage.cs
- PathFigureCollection.cs
- UnsafeNativeMethodsCLR.cs
- EncoderParameter.cs
- RequestQueryProcessor.cs
- PropertyPath.cs
- ScriptReferenceEventArgs.cs
- ListControl.cs
- NegotiationTokenAuthenticatorStateCache.cs
- DataGridViewCellCollection.cs
- NameSpaceExtractor.cs
- ProfileParameter.cs
- SmtpMail.cs
- FacetDescription.cs
- TransformCollection.cs
- PageAdapter.cs
- QueryCursorEventArgs.cs
- VarRemapper.cs
- DbProviderFactories.cs
- MemberRelationshipService.cs
- DeviceSpecificChoice.cs
- DataGridSortCommandEventArgs.cs
- PolicyVersionConverter.cs
- Scene3D.cs
- SqlServices.cs
- GuidConverter.cs
- PointAnimationUsingKeyFrames.cs
- ACE.cs
- sqlpipe.cs
- SubMenuStyle.cs
- UIInitializationException.cs
- XsltLibrary.cs
- CacheHelper.cs
- DictionaryGlobals.cs
- TcpTransportElement.cs
- ContractMapping.cs
- SecurityCriticalDataForSet.cs
- ContractUtils.cs
- DecoderFallback.cs
- DragDeltaEventArgs.cs
- AppSettingsExpressionBuilder.cs
- LinqDataSourceDeleteEventArgs.cs
- DbDataSourceEnumerator.cs
- DependencyPropertyValueSerializer.cs
- ClaimComparer.cs
- StorageTypeMapping.cs
- IteratorFilter.cs
- DotExpr.cs
- QuaternionAnimation.cs
- NamespaceQuery.cs
- UserControl.cs
- Int16AnimationUsingKeyFrames.cs
- DoubleCollectionConverter.cs
- ExpressionList.cs