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
- DependencyObjectProvider.cs
- WebDescriptionAttribute.cs
- StringValidator.cs
- FieldToken.cs
- ErrorWebPart.cs
- StrokeIntersection.cs
- FormatterServices.cs
- GcSettings.cs
- AttributeCollection.cs
- RawStylusSystemGestureInputReport.cs
- CleanUpVirtualizedItemEventArgs.cs
- xmlfixedPageInfo.cs
- JoinSymbol.cs
- BigInt.cs
- FileDialog_Vista_Interop.cs
- EntityDataSourceContainerNameItem.cs
- Utils.cs
- RuntimeCompatibilityAttribute.cs
- TraceContextRecord.cs
- DateTimeParse.cs
- CollectionsUtil.cs
- TerminatorSinks.cs
- DataGridTableCollection.cs
- SystemIPGlobalProperties.cs
- LocatorBase.cs
- HttpContextServiceHost.cs
- ListViewGroupItemCollection.cs
- SuspendDesigner.cs
- Label.cs
- XNodeValidator.cs
- Property.cs
- ImplicitInputBrush.cs
- HandlerMappingMemo.cs
- RawMouseInputReport.cs
- __Filters.cs
- TargetFrameworkUtil.cs
- EncodingStreamWrapper.cs
- InternalException.cs
- Executor.cs
- Configuration.cs
- ColumnResizeAdorner.cs
- Html32TextWriter.cs
- AggregateNode.cs
- InternalConfigSettingsFactory.cs
- ListCollectionView.cs
- NavigationCommands.cs
- DataError.cs
- BuildProviderCollection.cs
- Char.cs
- Sentence.cs
- GeometryModel3D.cs
- Function.cs
- HtmlFormWrapper.cs
- DataControlPagerLinkButton.cs
- KeyPullup.cs
- PrintPageEvent.cs
- DynamicValueConverter.cs
- Parameter.cs
- SparseMemoryStream.cs
- UnknownBitmapDecoder.cs
- IDQuery.cs
- OLEDB_Enum.cs
- DynamicControl.cs
- ItemType.cs
- ResourceReferenceKeyNotFoundException.cs
- TimeSpanSecondsConverter.cs
- ProgressBarHighlightConverter.cs
- WebPartMovingEventArgs.cs
- WinEventHandler.cs
- CustomAttributeSerializer.cs
- ReferentialConstraintRoleElement.cs
- XmlSchemaCompilationSettings.cs
- CacheSection.cs
- TabRenderer.cs
- Header.cs
- GroupByExpressionRewriter.cs
- XPathDocumentIterator.cs
- ExtentCqlBlock.cs
- WorkflowRuntimeSection.cs
- ComPlusServiceLoader.cs
- BitStack.cs
- SkipQueryOptionExpression.cs
- PersonalizationAdministration.cs
- UserControl.cs
- PackageRelationshipSelector.cs
- JournalNavigationScope.cs
- ServerReliableChannelBinder.cs
- SessionStateModule.cs
- SafeHandles.cs
- WebPartConnectionsConnectVerb.cs
- _HelperAsyncResults.cs
- SecureStringHasher.cs
- LogicalExpr.cs
- SmtpReplyReader.cs
- DefaultTraceListener.cs
- CodeDomSerializerBase.cs
- SchemaImporterExtension.cs
- BaseDataBoundControl.cs
- ClrProviderManifest.cs
- DriveNotFoundException.cs