Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ImpersonateTokenRef.cs / 1305376 / 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
- RootBuilder.cs
- ReturnValue.cs
- WebPartZoneBaseDesigner.cs
- CodePropertyReferenceExpression.cs
- ProfileBuildProvider.cs
- ListControl.cs
- WebConfigurationManager.cs
- SqlDeflator.cs
- DataSourceSerializationException.cs
- BitmapFrameDecode.cs
- AsynchronousChannelMergeEnumerator.cs
- SequenceNumber.cs
- FunctionImportElement.cs
- PersonalizableTypeEntry.cs
- XmlILIndex.cs
- FlowDocumentPaginator.cs
- ObjectHelper.cs
- UnicastIPAddressInformationCollection.cs
- SurrogateSelector.cs
- SchemaNames.cs
- InvokeGenerator.cs
- MatrixAnimationUsingPath.cs
- HitTestWithPointDrawingContextWalker.cs
- DynamicArgumentDialog.cs
- HttpModulesSection.cs
- RuntimeUtils.cs
- ObjectNavigationPropertyMapping.cs
- ObjectComplexPropertyMapping.cs
- Resources.Designer.cs
- PageCatalogPart.cs
- AutoSizeToolBoxItem.cs
- TextEmbeddedObject.cs
- DesignerValidatorAdapter.cs
- RadioButtonStandardAdapter.cs
- SelectionPatternIdentifiers.cs
- EnumerableRowCollection.cs
- ServiceSettingsResponseInfo.cs
- ExtractorMetadata.cs
- _emptywebproxy.cs
- XmlSchemaObject.cs
- SecurityPolicySection.cs
- ActionFrame.cs
- EnumerableRowCollectionExtensions.cs
- GuidTagList.cs
- TabItem.cs
- ProfilePropertyMetadata.cs
- LicFileLicenseProvider.cs
- MatchingStyle.cs
- SignedXml.cs
- InlineCollection.cs
- SoapEnumAttribute.cs
- Dictionary.cs
- Delegate.cs
- ComboBox.cs
- ObjectManager.cs
- ByValueEqualityComparer.cs
- DataGridViewLinkColumn.cs
- ThreadStateException.cs
- DataSourceCache.cs
- PropertyEmitter.cs
- TypeForwardedToAttribute.cs
- IProducerConsumerCollection.cs
- MimeFormatter.cs
- OleDbException.cs
- ParameterModifier.cs
- BulletedListDesigner.cs
- RegionInfo.cs
- SystemEvents.cs
- CachedFontFamily.cs
- Queue.cs
- WebPartVerbsEventArgs.cs
- BasicViewGenerator.cs
- DataTableMapping.cs
- SkewTransform.cs
- ProfileProvider.cs
- ParsedAttributeCollection.cs
- FixedPage.cs
- DataRowComparer.cs
- TextBoxView.cs
- BuildResult.cs
- SafeEventLogWriteHandle.cs
- XmlAttributeAttribute.cs
- OrderablePartitioner.cs
- PictureBox.cs
- DependencyPropertyDescriptor.cs
- IndexedEnumerable.cs
- MailAddressCollection.cs
- LostFocusEventManager.cs
- IndexedGlyphRun.cs
- BitmapEffectCollection.cs
- StickyNoteHelper.cs
- PersonalizationAdministration.cs
- XmlIncludeAttribute.cs
- VisualBasicValue.cs
- FixedSOMPageElement.cs
- ConfigurationStrings.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- DataPagerFieldCommandEventArgs.cs
- NonParentingControl.cs
- NTAccount.cs