Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- RoutedUICommand.cs
- OperationCanceledException.cs
- MessageDescription.cs
- PersonalizationProviderCollection.cs
- OdbcCommand.cs
- MimeParameterWriter.cs
- CompiledQuery.cs
- PowerStatus.cs
- securestring.cs
- DeferredElementTreeState.cs
- EventSetter.cs
- MinimizableAttributeTypeConverter.cs
- DesignerLoader.cs
- PolicyFactory.cs
- EditorZoneBase.cs
- EDesignUtil.cs
- DesignerSerializationOptionsAttribute.cs
- OleStrCAMarshaler.cs
- ResourcePool.cs
- Binding.cs
- GroupBox.cs
- SecurityManager.cs
- XmlDataCollection.cs
- TypedTableBaseExtensions.cs
- GeometryDrawing.cs
- OracleConnectionStringBuilder.cs
- MemberAccessException.cs
- TextMarkerSource.cs
- TypeConverterAttribute.cs
- LiteralText.cs
- CngAlgorithm.cs
- ControlAdapter.cs
- DataGridViewCellCancelEventArgs.cs
- WebPartAuthorizationEventArgs.cs
- ImageAttributes.cs
- FeatureSupport.cs
- ChangeInterceptorAttribute.cs
- ExitEventArgs.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- ActivityDefaults.cs
- BezierSegment.cs
- SchemaElementLookUpTableEnumerator.cs
- Highlights.cs
- CurrentChangingEventArgs.cs
- CodeSubDirectory.cs
- TerminateDesigner.cs
- FixUp.cs
- TdsParser.cs
- TraceInternal.cs
- DurableOperationContext.cs
- QueryResponse.cs
- GroupPartitionExpr.cs
- Exception.cs
- DuplicateContext.cs
- SemaphoreSlim.cs
- ConsoleTraceListener.cs
- ObservableDictionary.cs
- DataTrigger.cs
- BasicCommandTreeVisitor.cs
- XmlHierarchicalDataSourceView.cs
- Aes.cs
- CriticalExceptions.cs
- Zone.cs
- DbException.cs
- SmiGettersStream.cs
- BinaryWriter.cs
- Int16AnimationUsingKeyFrames.cs
- ApplicationSecurityInfo.cs
- SafeHandle.cs
- ModelVisual3D.cs
- SafeNativeMethods.cs
- ItemCheckEvent.cs
- ObjectItemNoOpAssemblyLoader.cs
- ByteStream.cs
- TabControlEvent.cs
- ExtractedStateEntry.cs
- MessageRpc.cs
- StylusCollection.cs
- Transform3DCollection.cs
- SelectionEditingBehavior.cs
- MultiTrigger.cs
- NominalTypeEliminator.cs
- UnitySerializationHolder.cs
- FontNamesConverter.cs
- TextServicesCompartmentContext.cs
- ThemeableAttribute.cs
- CultureInfo.cs
- ImageIndexEditor.cs
- ViewCellRelation.cs
- MatrixCamera.cs
- QilGenerator.cs
- _UriTypeConverter.cs
- DataGridItemCollection.cs
- MergablePropertyAttribute.cs
- BrowserCapabilitiesCompiler.cs
- OpenCollectionAsyncResult.cs
- GcHandle.cs
- ContextMenu.cs
- shaperfactoryquerycacheentry.cs
- SystemInformation.cs