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
- controlskin.cs
- SafeProcessHandle.cs
- HttpApplicationFactory.cs
- BamlStream.cs
- FileEnumerator.cs
- ErrorWrapper.cs
- ActivityExecutor.cs
- NamedPipeTransportManager.cs
- BoundColumn.cs
- CustomTypeDescriptor.cs
- RadioButtonBaseAdapter.cs
- CodeCompileUnit.cs
- _IPv6Address.cs
- CodeObjectCreateExpression.cs
- ToolStripDesigner.cs
- StrokeFIndices.cs
- ButtonChrome.cs
- XmlWellformedWriter.cs
- LinearGradientBrush.cs
- CacheAxisQuery.cs
- NotEqual.cs
- HttpModuleAction.cs
- MDIControlStrip.cs
- ConfigurationManagerHelper.cs
- ColorConverter.cs
- BaseTemplateParser.cs
- GeneralTransformGroup.cs
- ProtectedConfiguration.cs
- FilterElement.cs
- X509RawDataKeyIdentifierClause.cs
- CapabilitiesSection.cs
- WebScriptMetadataMessage.cs
- InvalidPipelineStoreException.cs
- TransformedBitmap.cs
- AxHostDesigner.cs
- OpCodes.cs
- GridToolTip.cs
- SafeUserTokenHandle.cs
- FocusTracker.cs
- SessionPageStateSection.cs
- Latin1Encoding.cs
- ConnectionPoolManager.cs
- RelOps.cs
- DataGridViewRowPostPaintEventArgs.cs
- sqlnorm.cs
- DES.cs
- DataIdProcessor.cs
- RealizationDrawingContextWalker.cs
- WrappedIUnknown.cs
- LinqMaximalSubtreeNominator.cs
- SortExpressionBuilder.cs
- NumericExpr.cs
- SspiSecurityTokenProvider.cs
- SymLanguageType.cs
- CodeIndexerExpression.cs
- KeyValuePairs.cs
- BinaryNegotiation.cs
- TextServicesCompartmentEventSink.cs
- FrameworkElement.cs
- ToolStripPanel.cs
- BitmapEffectDrawing.cs
- InputLangChangeRequestEvent.cs
- URLIdentityPermission.cs
- ModulesEntry.cs
- StreamResourceInfo.cs
- ThreadAbortException.cs
- HtmlControlPersistable.cs
- EmptyEnumerator.cs
- ReadOnlyHierarchicalDataSource.cs
- WSHttpBinding.cs
- Asn1IntegerConverter.cs
- DataGridViewLinkColumn.cs
- XmlAnyElementAttribute.cs
- SystemPens.cs
- DetailsViewCommandEventArgs.cs
- ClipboardData.cs
- SecurityPermission.cs
- StatusStrip.cs
- LinqDataSourceDisposeEventArgs.cs
- NetWebProxyFinder.cs
- UpdateRecord.cs
- BindingSource.cs
- TextBoxBase.cs
- TriState.cs
- LinearQuaternionKeyFrame.cs
- HtmlMobileTextWriter.cs
- BlurBitmapEffect.cs
- DataMemberAttribute.cs
- PropVariant.cs
- PointHitTestResult.cs
- AbsoluteQuery.cs
- SQLByte.cs
- AssemblyBuilderData.cs
- XmlSerializer.cs
- Line.cs
- _emptywebproxy.cs
- Symbol.cs
- CanonicalFontFamilyReference.cs
- PageFunction.cs
- ScriptMethodAttribute.cs