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
- StylusDevice.cs
- XPathNavigator.cs
- TemplateGroupCollection.cs
- NavigationProgressEventArgs.cs
- Keywords.cs
- GroupBoxAutomationPeer.cs
- BitmapSourceSafeMILHandle.cs
- UIElementAutomationPeer.cs
- ConnectionManagementSection.cs
- NetMsmqSecurityElement.cs
- DataGridItem.cs
- ScriptBehaviorDescriptor.cs
- securestring.cs
- HostExecutionContextManager.cs
- FreezableOperations.cs
- CustomWebEventKey.cs
- WebColorConverter.cs
- ObjectMemberMapping.cs
- HeaderedItemsControl.cs
- Lease.cs
- HotSpot.cs
- GeometryValueSerializer.cs
- PageHandlerFactory.cs
- ISAPIRuntime.cs
- OutputCacheProfileCollection.cs
- WebException.cs
- _ShellExpression.cs
- SAPIEngineTypes.cs
- ButtonAutomationPeer.cs
- SequenceFullException.cs
- SqlGenerator.cs
- SynthesizerStateChangedEventArgs.cs
- Knowncolors.cs
- LocatorBase.cs
- ExceptionHandlerDesigner.cs
- SafeProcessHandle.cs
- ToolStripScrollButton.cs
- safemediahandle.cs
- NetworkStream.cs
- QilInvoke.cs
- DecoderExceptionFallback.cs
- SimpleType.cs
- Tokenizer.cs
- VSWCFServiceContractGenerator.cs
- PixelFormatConverter.cs
- UnsafeNativeMethods.cs
- PolyQuadraticBezierSegment.cs
- DocumentXPathNavigator.cs
- PathSegmentCollection.cs
- SecurityDocument.cs
- UnicodeEncoding.cs
- HyperLinkColumn.cs
- TcpChannelHelper.cs
- TableHeaderCell.cs
- CodeGroup.cs
- PathStreamGeometryContext.cs
- EventlogProvider.cs
- COM2ComponentEditor.cs
- Overlapped.cs
- WindowsScrollBar.cs
- Identity.cs
- DataSourceXmlAttributeAttribute.cs
- RubberbandSelector.cs
- AssemblyInfo.cs
- CacheForPrimitiveTypes.cs
- LineMetrics.cs
- ButtonBaseDesigner.cs
- NamespaceInfo.cs
- CollectionChangedEventManager.cs
- TemplateColumn.cs
- HwndMouseInputProvider.cs
- RSAPKCS1KeyExchangeFormatter.cs
- AuthenticodeSignatureInformation.cs
- AudioException.cs
- TransformValueSerializer.cs
- SQLInt32.cs
- SqlNotificationRequest.cs
- WhitespaceRule.cs
- IndexedGlyphRun.cs
- SelectionPattern.cs
- JavaScriptSerializer.cs
- TableStyle.cs
- BitmapData.cs
- XmlWellformedWriter.cs
- Utils.cs
- ObjectConverter.cs
- ToolStripButton.cs
- CommandHelpers.cs
- _SecureChannel.cs
- SubMenuStyleCollection.cs
- URLString.cs
- Recipient.cs
- DataComponentNameHandler.cs
- HtmlControl.cs
- GridErrorDlg.cs
- ReaderOutput.cs
- JpegBitmapDecoder.cs
- DrawingGroupDrawingContext.cs
- EntityDataReader.cs
- PenThreadWorker.cs