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
- BindingOperations.cs
- invalidudtexception.cs
- MessageEncoder.cs
- XmlSchemaObjectTable.cs
- BuildProvidersCompiler.cs
- NodeInfo.cs
- CustomAttribute.cs
- XmlElementAttributes.cs
- QilPatternVisitor.cs
- FieldNameLookup.cs
- SynchronizedDisposablePool.cs
- LocalizabilityAttribute.cs
- CLRBindingWorker.cs
- Int32.cs
- ContentElementCollection.cs
- OpenCollectionAsyncResult.cs
- KeyEvent.cs
- WindowsRebar.cs
- HttpServerVarsCollection.cs
- DocumentXmlWriter.cs
- SelectingProviderEventArgs.cs
- ZeroOpNode.cs
- Image.cs
- DocumentOrderQuery.cs
- UIPropertyMetadata.cs
- XmlNamedNodeMap.cs
- XmlWriterTraceListener.cs
- XmlName.cs
- RecordsAffectedEventArgs.cs
- StandardOleMarshalObject.cs
- ProcessHostConfigUtils.cs
- TemplateDefinition.cs
- InstalledFontCollection.cs
- PropertyConverter.cs
- ReachPageContentSerializerAsync.cs
- InternalUserCancelledException.cs
- Native.cs
- DelegateTypeInfo.cs
- PrintDialogException.cs
- CollectionViewGroup.cs
- CommandDevice.cs
- ProfileEventArgs.cs
- RegexCompilationInfo.cs
- SafeCoTaskMem.cs
- ItemsPanelTemplate.cs
- OuterProxyWrapper.cs
- SQLDouble.cs
- PropertyInformationCollection.cs
- StateWorkerRequest.cs
- TypeTypeConverter.cs
- ChildDocumentBlock.cs
- EntityDataSourceContextCreatingEventArgs.cs
- Geometry3D.cs
- CodeTypeReference.cs
- Rights.cs
- MobileRedirect.cs
- PathGradientBrush.cs
- DescriptionCreator.cs
- thaishape.cs
- HttpChannelListener.cs
- XmlChildEnumerator.cs
- Constants.cs
- ServiceMetadataExtension.cs
- LocatorBase.cs
- GrammarBuilder.cs
- wmiprovider.cs
- AutomationPeer.cs
- TextRenderer.cs
- MSAAWinEventWrap.cs
- TextParagraphProperties.cs
- httpstaticobjectscollection.cs
- StyleXamlTreeBuilder.cs
- ReadOnlyPropertyMetadata.cs
- CalendarModeChangedEventArgs.cs
- HtmlForm.cs
- FormattedText.cs
- DrawItemEvent.cs
- SkinBuilder.cs
- XmlSchemaIdentityConstraint.cs
- XmlnsCompatibleWithAttribute.cs
- COM2PictureConverter.cs
- WebPartConnectionsConnectVerb.cs
- ScrollItemPattern.cs
- SignatureDescription.cs
- TraceUtility.cs
- XmlSerializableReader.cs
- CompiledQueryCacheKey.cs
- documentsequencetextcontainer.cs
- RoleManagerModule.cs
- BookmarkNameHelper.cs
- prompt.cs
- ImageMap.cs
- AsymmetricSignatureDeformatter.cs
- GuidelineCollection.cs
- SerializationException.cs
- ItemsPresenter.cs
- CorrelationActionMessageFilter.cs
- Normalization.cs
- MissingFieldException.cs
- ArithmeticException.cs