Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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
- ItemDragEvent.cs
- GroupStyle.cs
- AllowedAudienceUriElementCollection.cs
- ContractTypeNameElement.cs
- _WebProxyDataBuilder.cs
- BasicExpressionVisitor.cs
- X509SecurityTokenAuthenticator.cs
- HashHelper.cs
- ApplicationProxyInternal.cs
- QueryReaderSettings.cs
- MailHeaderInfo.cs
- MimeMapping.cs
- BindingContext.cs
- GridViewSortEventArgs.cs
- ResourceDescriptionAttribute.cs
- ItemsPresenter.cs
- SamlAdvice.cs
- WithStatement.cs
- PriorityChain.cs
- TextSpanModifier.cs
- Subtree.cs
- ConfigXmlElement.cs
- PropertyPathConverter.cs
- EventSource.cs
- HtmlTitle.cs
- SHA512Managed.cs
- RsaSecurityTokenAuthenticator.cs
- XmlSerializerFactory.cs
- BrowserCapabilitiesFactory.cs
- WMIGenerator.cs
- CacheRequest.cs
- Fonts.cs
- _NegotiateClient.cs
- ReferencedAssembly.cs
- MinimizableAttributeTypeConverter.cs
- OleDbError.cs
- DesignerWidgets.cs
- MarkupCompiler.cs
- AtomPub10CategoriesDocumentFormatter.cs
- SelectedDatesCollection.cs
- WorkflowTraceTransfer.cs
- SqlClientMetaDataCollectionNames.cs
- MessagingDescriptionAttribute.cs
- TypedColumnHandler.cs
- HitTestParameters.cs
- TableLayoutStyleCollection.cs
- DiscoveryClientRequestChannel.cs
- Repeater.cs
- DataGridViewCellLinkedList.cs
- FormattedText.cs
- WindowProviderWrapper.cs
- CompileLiteralTextParser.cs
- Parameter.cs
- SafeNativeMethods.cs
- ContentIterators.cs
- CheckBox.cs
- CustomCategoryAttribute.cs
- ProviderSettingsCollection.cs
- BaseCAMarshaler.cs
- ColorContext.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- GridEntry.cs
- Char.cs
- TerminateDesigner.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DeploymentExceptionMapper.cs
- DictionaryEditChange.cs
- ImageIndexConverter.cs
- AssociatedControlConverter.cs
- ListViewInsertEventArgs.cs
- ConfigurationErrorsException.cs
- CompileLiteralTextParser.cs
- PropagatorResult.cs
- ItemChangedEventArgs.cs
- RequestQueue.cs
- DBPropSet.cs
- PolygonHotSpot.cs
- DateRangeEvent.cs
- BulletedListEventArgs.cs
- AppDomainFactory.cs
- ITextView.cs
- SchemaNamespaceManager.cs
- PeerApplication.cs
- MultiView.cs
- HttpHandlersSection.cs
- StylusLogic.cs
- StylusDownEventArgs.cs
- XComponentModel.cs
- AsyncOperation.cs
- DataGridViewAdvancedBorderStyle.cs
- ByteArrayHelperWithString.cs
- IPCCacheManager.cs
- FrameworkName.cs
- CommandDevice.cs
- nulltextnavigator.cs
- ObjectDataSourceView.cs
- CodeMemberField.cs
- EncoderReplacementFallback.cs
- FixedPage.cs
- FileNotFoundException.cs