Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SafeRightsManagementEnvironmentHandle.cs
- ConfigXmlWhitespace.cs
- ModifiableIteratorCollection.cs
- SqlReorderer.cs
- Margins.cs
- DataObjectFieldAttribute.cs
- ServiceMoniker.cs
- WebPartManagerInternals.cs
- RunClient.cs
- X509Utils.cs
- ValidationVisibilityAttribute.cs
- XmlSerializerSection.cs
- RangeBase.cs
- altserialization.cs
- Registry.cs
- FacetValues.cs
- Vector3DKeyFrameCollection.cs
- RootBrowserWindowAutomationPeer.cs
- WebPartConnectionsConfigureVerb.cs
- Int32Converter.cs
- DataContext.cs
- BamlTreeUpdater.cs
- ImplicitInputBrush.cs
- CounterCreationDataCollection.cs
- Track.cs
- HtmlControlDesigner.cs
- DataViewSetting.cs
- BufferedOutputStream.cs
- OleTxTransactionInfo.cs
- ApplicationManager.cs
- RotateTransform.cs
- MD5CryptoServiceProvider.cs
- SqlConnection.cs
- TableDetailsCollection.cs
- OleDbConnectionFactory.cs
- DataSourceHelper.cs
- ObjectDataProvider.cs
- TraceRecord.cs
- GridViewCommandEventArgs.cs
- RowUpdatedEventArgs.cs
- PassportAuthenticationModule.cs
- _CacheStreams.cs
- MoveSizeWinEventHandler.cs
- TextAdaptor.cs
- ReferenceConverter.cs
- ReadOnlyDataSourceView.cs
- ISAPIWorkerRequest.cs
- ListParaClient.cs
- UnsafeNativeMethods.cs
- BCLDebug.cs
- future.cs
- DebugView.cs
- ProfilePropertyNameValidator.cs
- ObfuscateAssemblyAttribute.cs
- FileNotFoundException.cs
- InputReport.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- MaterialCollection.cs
- StorageEntitySetMapping.cs
- Int16KeyFrameCollection.cs
- Win32SafeHandles.cs
- SchemaObjectWriter.cs
- ColumnReorderedEventArgs.cs
- XmlEntityReference.cs
- BulletDecorator.cs
- RoutedCommand.cs
- BackEase.cs
- PublisherMembershipCondition.cs
- remotingproxy.cs
- XslUrlEditor.cs
- ToolStripRenderEventArgs.cs
- TabletCollection.cs
- JoinCqlBlock.cs
- DateTimeOffsetAdapter.cs
- XmlSchemaAnyAttribute.cs
- SqlRetyper.cs
- ObjectDisposedException.cs
- OutputCacheProfile.cs
- DrawTreeNodeEventArgs.cs
- ElementMarkupObject.cs
- DataRowView.cs
- ToolStripDropDown.cs
- Propagator.cs
- StringDictionaryCodeDomSerializer.cs
- ValidatorCompatibilityHelper.cs
- DataGridViewCellCancelEventArgs.cs
- AddInControllerImpl.cs
- IChannel.cs
- SourceFilter.cs
- LogSwitch.cs
- LookupNode.cs
- DataServiceResponse.cs
- MessageSecurityProtocolFactory.cs
- ProjectionAnalyzer.cs
- DbDeleteCommandTree.cs
- ImageField.cs
- SimpleWebHandlerParser.cs
- SafeProcessHandle.cs
- Label.cs
- TileBrush.cs