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
- SmiEventStream.cs
- AuthenticateEventArgs.cs
- BitmapEffectOutputConnector.cs
- StringDictionary.cs
- ExecutedRoutedEventArgs.cs
- RoutedCommand.cs
- SecurityHelper.cs
- JulianCalendar.cs
- TearOffProxy.cs
- MessagingDescriptionAttribute.cs
- FocusWithinProperty.cs
- ToolStripSeparatorRenderEventArgs.cs
- CryptoApi.cs
- Size3D.cs
- XmlSchemaSimpleTypeUnion.cs
- ColorConvertedBitmap.cs
- WebPartConnectionCollection.cs
- DBConnection.cs
- StringConcat.cs
- InkCanvasAutomationPeer.cs
- TextPenaltyModule.cs
- Expressions.cs
- VirtualizingStackPanel.cs
- PasswordTextContainer.cs
- ChtmlLinkAdapter.cs
- ObjRef.cs
- HyperLink.cs
- ToolStrip.cs
- DockProviderWrapper.cs
- Int32RectValueSerializer.cs
- ObjectDataSourceFilteringEventArgs.cs
- BlobPersonalizationState.cs
- KnownColorTable.cs
- OdbcConnectionHandle.cs
- CodeParameterDeclarationExpression.cs
- SqlConnectionPoolGroupProviderInfo.cs
- UrlMappingsSection.cs
- ColorTransformHelper.cs
- Itemizer.cs
- Semaphore.cs
- OleDbWrapper.cs
- ContainerControl.cs
- PropertyEmitterBase.cs
- EntityWrapper.cs
- ListViewTableCell.cs
- BitmapEffectGroup.cs
- BookmarkEventArgs.cs
- BamlTreeUpdater.cs
- PathGradientBrush.cs
- BamlStream.cs
- TextParagraphProperties.cs
- FormClosedEvent.cs
- TextTrailingCharacterEllipsis.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SizeValueSerializer.cs
- Rijndael.cs
- ResourceDictionary.cs
- RootProfilePropertySettingsCollection.cs
- PerformanceCounterLib.cs
- Variable.cs
- InputManager.cs
- Int64Storage.cs
- DNS.cs
- ItemsPanelTemplate.cs
- PathFigure.cs
- Win32KeyboardDevice.cs
- MultiPageTextView.cs
- DbDataAdapter.cs
- Compiler.cs
- ProviderSettings.cs
- DateTimeSerializationSection.cs
- VBIdentifierNameEditor.cs
- ChtmlTextWriter.cs
- MexServiceChannelBuilder.cs
- PackagePart.cs
- PointHitTestResult.cs
- WindowsClaimSet.cs
- CorrelationKeyCalculator.cs
- DataGrid.cs
- DbModificationClause.cs
- MaterializeFromAtom.cs
- WebPartDisplayModeEventArgs.cs
- BitmapEffectDrawing.cs
- SiteMapProvider.cs
- BuildManager.cs
- IndentedWriter.cs
- SimpleWebHandlerParser.cs
- UserControlCodeDomTreeGenerator.cs
- SoapConverter.cs
- dbdatarecord.cs
- PrinterUnitConvert.cs
- GenericsNotImplementedException.cs
- BinaryUtilClasses.cs
- PassportIdentity.cs
- DelimitedListTraceListener.cs
- PopupControlService.cs
- XmlSchemaExternal.cs
- AnnouncementEventArgs.cs
- FormsIdentity.cs
- MDIWindowDialog.cs