Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- GeometryGroup.cs
- IdleTimeoutMonitor.cs
- PropertyValueChangedEvent.cs
- DateTime.cs
- ToolStripDropDownItem.cs
- SymLanguageType.cs
- Resources.Designer.cs
- Item.cs
- ApplicationServiceManager.cs
- PersonalizationProviderCollection.cs
- InstanceData.cs
- Operator.cs
- XmlEntityReference.cs
- PreviewPageInfo.cs
- WebZone.cs
- DocumentPageViewAutomationPeer.cs
- MessageDirection.cs
- PreProcessInputEventArgs.cs
- WebPartActionVerb.cs
- XmlArrayItemAttributes.cs
- connectionpool.cs
- SystemParameters.cs
- TextOptionsInternal.cs
- Avt.cs
- CacheDependency.cs
- PictureBox.cs
- PrinterResolution.cs
- X509Chain.cs
- ObjectDataSourceView.cs
- DataSourceXmlElementAttribute.cs
- UTF7Encoding.cs
- StorageEntityContainerMapping.cs
- SqlParameterizer.cs
- ReferentialConstraint.cs
- DataRow.cs
- StatusBarAutomationPeer.cs
- NameObjectCollectionBase.cs
- AutoCompleteStringCollection.cs
- ContextMenuAutomationPeer.cs
- ControlCollection.cs
- HostedElements.cs
- ChineseLunisolarCalendar.cs
- XhtmlBasicLiteralTextAdapter.cs
- WebPartAddingEventArgs.cs
- ImportCatalogPart.cs
- PeerResolverElement.cs
- Model3DGroup.cs
- XmlImplementation.cs
- VectorAnimationUsingKeyFrames.cs
- CodeSnippetTypeMember.cs
- XamlTypeMapper.cs
- Misc.cs
- GlobalItem.cs
- SyndicationPerson.cs
- TCPListener.cs
- TemplateBindingExpression.cs
- SqlDataSourceSelectingEventArgs.cs
- ProcessInfo.cs
- CategoryNameCollection.cs
- FlowDocumentScrollViewer.cs
- ConcurrentDictionary.cs
- SQLDecimal.cs
- KeyToListMap.cs
- ConfigErrorGlyph.cs
- TypeDescriptionProviderAttribute.cs
- WindowsGraphics.cs
- WSFederationHttpBinding.cs
- Point3DAnimation.cs
- ApplicationFileParser.cs
- WindowsRebar.cs
- InternalCache.cs
- ReadOnlyNameValueCollection.cs
- BamlBinaryReader.cs
- UpdatePanelTrigger.cs
- CodeTypeReferenceCollection.cs
- Exception.cs
- UserPreferenceChangedEventArgs.cs
- PropertyDescriptorComparer.cs
- XmlSerializerFactory.cs
- DelegatedStream.cs
- Int32RectConverter.cs
- ObjectNotFoundException.cs
- XmlUtil.cs
- DataGridViewHitTestInfo.cs
- TabItemAutomationPeer.cs
- LinqDataSourceContextEventArgs.cs
- WorkflowDesignerMessageFilter.cs
- EntityDataSourceWrapperCollection.cs
- EventProviderWriter.cs
- SqlFacetAttribute.cs
- TextElementAutomationPeer.cs
- ECDiffieHellmanCng.cs
- DataRelationCollection.cs
- ToolBarPanel.cs
- ResolveCompletedEventArgs.cs
- NavigationProperty.cs
- _LazyAsyncResult.cs
- EntityClientCacheEntry.cs
- LayoutEditorPart.cs
- ListBoxItemWrapperAutomationPeer.cs