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
- DSACryptoServiceProvider.cs
- _NativeSSPI.cs
- DataFieldCollectionEditor.cs
- EdmEntityTypeAttribute.cs
- StyleBamlTreeBuilder.cs
- Roles.cs
- ImageBrush.cs
- ResizeGrip.cs
- HostingPreferredMapPath.cs
- CalendarTable.cs
- TextRunCache.cs
- EventTrigger.cs
- DynamicDataManager.cs
- MetadataUtilsSmi.cs
- GradientBrush.cs
- TemplateComponentConnector.cs
- WebSysDefaultValueAttribute.cs
- DoubleAnimationBase.cs
- PlainXmlWriter.cs
- CapacityStreamGeometryContext.cs
- StubHelpers.cs
- StorageTypeMapping.cs
- LogAppendAsyncResult.cs
- ExpressionEditorAttribute.cs
- SQLInt64.cs
- InfoCardBinaryReader.cs
- AnimationStorage.cs
- MultiTouchSystemGestureLogic.cs
- ComboBoxAutomationPeer.cs
- _SecureChannel.cs
- CursorInteropHelper.cs
- EllipticalNodeOperations.cs
- SHA512CryptoServiceProvider.cs
- lengthconverter.cs
- CompilerTypeWithParams.cs
- XmlSerializerSection.cs
- StrokeCollectionDefaultValueFactory.cs
- VoiceSynthesis.cs
- ComponentDesigner.cs
- ActivityCodeDomReferenceService.cs
- WindowsListViewGroup.cs
- SqlDataSourceQueryEditorForm.cs
- DynamicHyperLink.cs
- MouseButton.cs
- TableChangeProcessor.cs
- CompilerErrorCollection.cs
- CalendarDateChangedEventArgs.cs
- SingleAnimation.cs
- Enum.cs
- SqlError.cs
- BindingGroup.cs
- QuaternionAnimation.cs
- RemoteWebConfigurationHost.cs
- D3DImage.cs
- InputLanguageCollection.cs
- ImageIndexConverter.cs
- FixedStringLookup.cs
- BasicExpandProvider.cs
- HeaderedItemsControl.cs
- PasswordBox.cs
- CurrencyManager.cs
- RtfToXamlLexer.cs
- GridViewItemAutomationPeer.cs
- AnimationTimeline.cs
- RegexTypeEditor.cs
- TimeSpan.cs
- TdsEnums.cs
- Oci.cs
- DataGridCell.cs
- ModelTreeEnumerator.cs
- WeakEventTable.cs
- RoutingExtensionElement.cs
- TextTreeNode.cs
- AttributeQuery.cs
- ComponentCollection.cs
- HttpCapabilitiesSectionHandler.cs
- WindowAutomationPeer.cs
- SvcMapFileLoader.cs
- FixUpCollection.cs
- ControlParameter.cs
- MetadataItemCollectionFactory.cs
- ApplicationFileParser.cs
- XslNumber.cs
- FillErrorEventArgs.cs
- FastEncoderStatics.cs
- Popup.cs
- ModelTypeConverter.cs
- XmlSchemaInfo.cs
- DateTimeOffsetStorage.cs
- BamlRecords.cs
- NumberAction.cs
- KoreanCalendar.cs
- CompiledIdentityConstraint.cs
- RangeContentEnumerator.cs
- CodeTypeParameterCollection.cs
- ContainerControl.cs
- ImportCatalogPart.cs
- NoResizeSelectionBorderGlyph.cs
- PerformanceCounterPermission.cs
- UrlAuthFailedErrorFormatter.cs