Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListenerAdapter.cs
- BitmapImage.cs
- ListViewGroupItemCollection.cs
- InputLanguageManager.cs
- InheritanceAttribute.cs
- OutOfProcStateClientManager.cs
- ErrorInfoXmlDocument.cs
- CustomLineCap.cs
- UnionCqlBlock.cs
- EntityUtil.cs
- VideoDrawing.cs
- BufferModeSettings.cs
- DrawingCollection.cs
- SimpleHandlerBuildProvider.cs
- LicenseContext.cs
- PrintEvent.cs
- ToolStripItemRenderEventArgs.cs
- TypeUtil.cs
- CounterSetInstance.cs
- CompoundFileStorageReference.cs
- DynamicILGenerator.cs
- SafeFileMappingHandle.cs
- DataGridRelationshipRow.cs
- PackageDigitalSignature.cs
- CodeObjectCreateExpression.cs
- EventLogReader.cs
- InputLangChangeRequestEvent.cs
- HttpHandlerActionCollection.cs
- WindowsFormsSynchronizationContext.cs
- EdmValidator.cs
- XmlnsCompatibleWithAttribute.cs
- FontNamesConverter.cs
- HTTPRemotingHandler.cs
- PermissionListSet.cs
- MetadataPropertyCollection.cs
- AnnotationAdorner.cs
- ValueConversionAttribute.cs
- TraceListeners.cs
- Mappings.cs
- WinCategoryAttribute.cs
- SqlCommandBuilder.cs
- ButtonField.cs
- DataGridRow.cs
- MethodExpression.cs
- DeflateStream.cs
- ValuePatternIdentifiers.cs
- RowTypeElement.cs
- SafeSecurityHandles.cs
- linebase.cs
- BamlResourceContent.cs
- InvalidPrinterException.cs
- InnerItemCollectionView.cs
- OrderedDictionaryStateHelper.cs
- DataGridCaption.cs
- WebPartDescriptionCollection.cs
- StorageModelBuildProvider.cs
- DataComponentMethodGenerator.cs
- HttpClientCertificate.cs
- AppDomainProtocolHandler.cs
- FormattedText.cs
- XMLUtil.cs
- IPAddress.cs
- Select.cs
- MembershipUser.cs
- Classification.cs
- RowType.cs
- ButtonField.cs
- UnauthorizedWebPart.cs
- LingerOption.cs
- ReadOnlyObservableCollection.cs
- WaitHandle.cs
- GeneralTransform3D.cs
- SqlBuilder.cs
- WebPartConnectionCollection.cs
- PersianCalendar.cs
- basevalidator.cs
- RightsManagementManager.cs
- EmptyQuery.cs
- BevelBitmapEffect.cs
- XmlUtil.cs
- VirtualDirectoryMappingCollection.cs
- WorkflowPrinting.cs
- XmlChildNodes.cs
- EncoderFallback.cs
- EdmSchemaAttribute.cs
- ContentIterators.cs
- HotSpotCollection.cs
- RectValueSerializer.cs
- SingleAnimationUsingKeyFrames.cs
- SiteMapDataSourceView.cs
- CodeObjectCreateExpression.cs
- RegexMatchCollection.cs
- RegexMatchCollection.cs
- ToolStripTextBox.cs
- DeferrableContent.cs
- GcHandle.cs
- StagingAreaInputItem.cs
- WebPartsPersonalizationAuthorization.cs
- XmlText.cs
- MessagingActivityHelper.cs