Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / ImpersonateTokenRef.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewRow.cs
- RuntimeArgumentHandle.cs
- DbConnectionPoolCounters.cs
- tibetanshape.cs
- GridPatternIdentifiers.cs
- BulletedList.cs
- TaskFormBase.cs
- InstanceLockedException.cs
- DrawingGroupDrawingContext.cs
- HttpCachePolicyElement.cs
- ObjectMemberMapping.cs
- DbCommandDefinition.cs
- MsdtcWrapper.cs
- AudioException.cs
- documentation.cs
- PolyQuadraticBezierSegment.cs
- FileEnumerator.cs
- FormatException.cs
- CustomAttributeBuilder.cs
- ApplicationContext.cs
- CachedFontFace.cs
- ParenExpr.cs
- HttpCapabilitiesEvaluator.cs
- HttpWebResponse.cs
- ParseNumbers.cs
- AnimationClock.cs
- BrowserCapabilitiesFactoryBase.cs
- BinaryObjectWriter.cs
- PageAsyncTask.cs
- IteratorAsyncResult.cs
- ObjectParameter.cs
- FaultPropagationRecord.cs
- TypeSystemHelpers.cs
- BooleanFunctions.cs
- MetadataUtilsSmi.cs
- SoapMessage.cs
- SingleObjectCollection.cs
- CheckBoxPopupAdapter.cs
- ReadOnlyCollectionBuilder.cs
- EditorPartChrome.cs
- IntegerValidator.cs
- XmlValueConverter.cs
- BindingExpressionUncommonField.cs
- NonSerializedAttribute.cs
- DesignerVerb.cs
- ThreadNeutralSemaphore.cs
- ContextMenu.cs
- HandlerBase.cs
- DetailsViewInsertedEventArgs.cs
- SessionStateUtil.cs
- RadioButtonPopupAdapter.cs
- ClientScriptManagerWrapper.cs
- List.cs
- CheckedListBox.cs
- SponsorHelper.cs
- safelink.cs
- __Error.cs
- Substitution.cs
- XhtmlBasicCalendarAdapter.cs
- StylusPointDescription.cs
- SystemGatewayIPAddressInformation.cs
- SizeFConverter.cs
- PathFigure.cs
- Helpers.cs
- LambdaCompiler.Unary.cs
- WebServicesSection.cs
- ProcessHostConfigUtils.cs
- DataGrid.cs
- ProxyWebPartManagerDesigner.cs
- PositiveTimeSpanValidator.cs
- DataControlLinkButton.cs
- DetailsViewRow.cs
- XmlHierarchicalDataSourceView.cs
- ConfigurationStrings.cs
- SecurityChannelFactory.cs
- SingleObjectCollection.cs
- QilCloneVisitor.cs
- IconConverter.cs
- InstanceHandle.cs
- MessageSecurityOverTcpElement.cs
- CreateUserWizardAutoFormat.cs
- RenameRuleObjectDialog.cs
- CompatibleIComparer.cs
- X509ChainElement.cs
- SystemException.cs
- XmlDocument.cs
- CompatibleIComparer.cs
- AddInEnvironment.cs
- RNGCryptoServiceProvider.cs
- WebContentFormatHelper.cs
- InstanceValue.cs
- ReadOnlyNameValueCollection.cs
- LinkUtilities.cs
- SmtpNtlmAuthenticationModule.cs
- WebPartConnectionsConnectVerb.cs
- CommonProperties.cs
- _HTTPDateParse.cs
- SamlSecurityToken.cs
- GraphicsPath.cs
- UInt32Storage.cs