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
- XhtmlConformanceSection.cs
- MenuItemStyle.cs
- Pens.cs
- ControlBuilderAttribute.cs
- RawStylusSystemGestureInputReport.cs
- IPipelineRuntime.cs
- MaskedTextBox.cs
- XhtmlBasicControlAdapter.cs
- SoapFault.cs
- Validator.cs
- _ConnectOverlappedAsyncResult.cs
- ToolStripArrowRenderEventArgs.cs
- PropertyRecord.cs
- ArcSegment.cs
- CodeDomSerializerBase.cs
- HtmlElementCollection.cs
- ControlBuilder.cs
- ImportContext.cs
- EntityEntry.cs
- ToolStripSplitButton.cs
- XamlWrappingReader.cs
- ActivityExecutor.cs
- ButtonAutomationPeer.cs
- DataTableTypeConverter.cs
- ReadOnlyNameValueCollection.cs
- DeferredElementTreeState.cs
- ProfileGroupSettingsCollection.cs
- AsnEncodedData.cs
- ChtmlTextWriter.cs
- ExpressionHelper.cs
- DefaultPropertyAttribute.cs
- DateTime.cs
- RemoteWebConfigurationHost.cs
- ControlPropertyNameConverter.cs
- FactoryMaker.cs
- DesignerVerb.cs
- DrawingVisualDrawingContext.cs
- KnowledgeBase.cs
- figurelength.cs
- TypeSource.cs
- HorizontalAlignConverter.cs
- AlternateView.cs
- VisualStateChangedEventArgs.cs
- TextServicesLoader.cs
- CollectionTypeElement.cs
- RtfFormatStack.cs
- VolatileResourceManager.cs
- EntityDataSourceView.cs
- InvokePatternIdentifiers.cs
- ToolStripControlHost.cs
- ScriptControlDescriptor.cs
- MenuScrollingVisibilityConverter.cs
- PathSegment.cs
- XsdBuilder.cs
- SHA256Cng.cs
- DispatchChannelSink.cs
- GroupQuery.cs
- OutputCacheSettings.cs
- PolicyUnit.cs
- Application.cs
- pingexception.cs
- ContentElementAutomationPeer.cs
- SQLCharsStorage.cs
- FixedSOMTableRow.cs
- UrlAuthFailedErrorFormatter.cs
- DrawingImage.cs
- SimpleTypeResolver.cs
- FileRegion.cs
- SerializableAttribute.cs
- OdbcConnectionFactory.cs
- __TransparentProxy.cs
- Point3D.cs
- InstanceDataCollection.cs
- HtmlInputFile.cs
- ParagraphResult.cs
- ListComponentEditorPage.cs
- safex509handles.cs
- DllNotFoundException.cs
- EventManager.cs
- LocatorPartList.cs
- Misc.cs
- XmlObjectSerializerWriteContext.cs
- DataServiceQueryOfT.cs
- AndMessageFilter.cs
- WebMessageEncoderFactory.cs
- DbConnectionStringBuilder.cs
- StylusOverProperty.cs
- Matrix3DConverter.cs
- ChangeTracker.cs
- EntityViewContainer.cs
- CompoundFileStreamReference.cs
- ProgressPage.cs
- DataServiceQueryProvider.cs
- FloaterParaClient.cs
- WaitHandleCannotBeOpenedException.cs
- ValidatorCollection.cs
- GridViewUpdateEventArgs.cs
- ModifierKeysConverter.cs
- SqlVersion.cs
- FloaterBaseParagraph.cs