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
- StylusLogic.cs
- Command.cs
- DetailsViewModeEventArgs.cs
- DataSourceSelectArguments.cs
- HttpResponseHeader.cs
- ApplicationException.cs
- JsonObjectDataContract.cs
- DoubleLinkList.cs
- DataGridAutoFormatDialog.cs
- DataException.cs
- ReferenceConverter.cs
- PrintControllerWithStatusDialog.cs
- ContextProperty.cs
- OpenFileDialog.cs
- NetworkStream.cs
- SoapObjectInfo.cs
- SplitterPanelDesigner.cs
- SettingsProviderCollection.cs
- LongMinMaxAggregationOperator.cs
- SplitContainer.cs
- MouseDevice.cs
- XmlBinaryReader.cs
- InterleavedZipPartStream.cs
- EpmTargetTree.cs
- StateItem.cs
- ToolStripItem.cs
- PhonemeEventArgs.cs
- UnsafeNativeMethods.cs
- Rect3D.cs
- ProxyWebPartConnectionCollection.cs
- DefaultValueAttribute.cs
- AssemblyHash.cs
- _SpnDictionary.cs
- _ConnectOverlappedAsyncResult.cs
- SQLDoubleStorage.cs
- HitTestDrawingContextWalker.cs
- ComUdtElementCollection.cs
- Decorator.cs
- HttpFileCollectionBase.cs
- StringComparer.cs
- SafeNativeMethodsMilCoreApi.cs
- ExpressionBuilder.cs
- CheckBoxField.cs
- ConnectionsZone.cs
- Int32EqualityComparer.cs
- DependencyPropertyConverter.cs
- RequiredFieldValidator.cs
- UnsafeNativeMethods.cs
- PermissionSetEnumerator.cs
- unitconverter.cs
- SerializerDescriptor.cs
- BlobPersonalizationState.cs
- VirtualDirectoryMapping.cs
- SecurityStateEncoder.cs
- HttpProfileGroupBase.cs
- RegexRunner.cs
- PropertyInfo.cs
- KeyInterop.cs
- EntityDataReader.cs
- InstalledFontCollection.cs
- ILGenerator.cs
- BitVec.cs
- TypeGeneratedEventArgs.cs
- XamlFilter.cs
- SharedDp.cs
- SuppressMessageAttribute.cs
- FileRecordSequenceCompletedAsyncResult.cs
- CapabilitiesUse.cs
- DecoderFallback.cs
- MappingException.cs
- PauseStoryboard.cs
- ActivitySurrogateSelector.cs
- CatalogPartCollection.cs
- SequentialOutput.cs
- PropertyItemInternal.cs
- TextBoxView.cs
- GlyphTypeface.cs
- MimeWriter.cs
- CodeCompiler.cs
- XmlDataSourceNodeDescriptor.cs
- TrackingMemoryStream.cs
- InvariantComparer.cs
- IListConverters.cs
- MediaTimeline.cs
- DataGridHeaderBorder.cs
- CodeGotoStatement.cs
- ColorConverter.cs
- CustomLineCap.cs
- TimeoutValidationAttribute.cs
- ChannelManager.cs
- CompilationSection.cs
- ResourceReferenceKeyNotFoundException.cs
- RegexWorker.cs
- KnownTypes.cs
- EditingCoordinator.cs
- Bitmap.cs
- clipboard.cs
- securitycriticaldataClass.cs
- Baml6ConstructorInfo.cs
- AnnotationService.cs