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
- InvalidMessageContractException.cs
- XmlExtensionFunction.cs
- SerializationTrace.cs
- SyndicationDeserializer.cs
- AppSettingsSection.cs
- CompositeFontParser.cs
- InstanceLockedException.cs
- DecoderFallbackWithFailureFlag.cs
- HMACSHA256.cs
- ProcessModelSection.cs
- ShapingWorkspace.cs
- WsrmMessageInfo.cs
- PackagingUtilities.cs
- CodeStatementCollection.cs
- Authorization.cs
- WebPartMenu.cs
- ControlParameter.cs
- DLinqTableProvider.cs
- CLRBindingWorker.cs
- WeakReferenceEnumerator.cs
- Profiler.cs
- URI.cs
- OlePropertyStructs.cs
- ExplicitDiscriminatorMap.cs
- DrawingAttributesDefaultValueFactory.cs
- AuthenticatedStream.cs
- FixedSOMTableCell.cs
- _OSSOCK.cs
- WindowsStatic.cs
- RowCache.cs
- XmlLinkedNode.cs
- DragDeltaEventArgs.cs
- WebBrowserContainer.cs
- UserMapPath.cs
- Odbc32.cs
- VirtualPathProvider.cs
- FileRegion.cs
- updatecommandorderer.cs
- DocumentViewerBase.cs
- IgnoreFlushAndCloseStream.cs
- BindingManagerDataErrorEventArgs.cs
- ActivityExecutionFilter.cs
- QilXmlReader.cs
- ActiveDocumentEvent.cs
- SafeViewOfFileHandle.cs
- ValidatorUtils.cs
- ToolStripDropTargetManager.cs
- PropertyGeneratedEventArgs.cs
- RegularExpressionValidator.cs
- Point.cs
- SerializationFieldInfo.cs
- DocumentSequence.cs
- TypeResolvingOptions.cs
- BackoffTimeoutHelper.cs
- VarInfo.cs
- TableLayout.cs
- CurrencyManager.cs
- RelatedCurrencyManager.cs
- FlowLayoutSettings.cs
- InternalException.cs
- DESCryptoServiceProvider.cs
- VoiceInfo.cs
- CleanUpVirtualizedItemEventArgs.cs
- StatusBar.cs
- ProxyGenerationError.cs
- RepeatButton.cs
- FileUtil.cs
- OleDbConnectionInternal.cs
- ProgressBar.cs
- UnsafeNativeMethods.cs
- OleDbConnectionFactory.cs
- RegexInterpreter.cs
- InstanceKeyCompleteException.cs
- FaultDescriptionCollection.cs
- Point4DValueSerializer.cs
- ArraySubsetEnumerator.cs
- GenericUriParser.cs
- ProfileInfo.cs
- SqlMetaData.cs
- ExistsInCollection.cs
- ContainerAction.cs
- CodeIndexerExpression.cs
- TableLayoutCellPaintEventArgs.cs
- AttachedPropertiesService.cs
- XPathDocumentBuilder.cs
- InheritanceService.cs
- SqlVersion.cs
- ReturnType.cs
- CompositeDesignerAccessibleObject.cs
- BaseTreeIterator.cs
- Size.cs
- DocumentApplicationJournalEntry.cs
- RotateTransform.cs
- Stylesheet.cs
- COAUTHINFO.cs
- SourceInterpreter.cs
- BitStream.cs
- ObjectContext.cs
- MulticastDelegate.cs
- ConsumerConnectionPointCollection.cs