Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MailSettingsSection.cs
- BindingWorker.cs
- StateMachineSubscriptionManager.cs
- HttpStreamFormatter.cs
- OnOperation.cs
- RsaSecurityToken.cs
- BitmapEffectrendercontext.cs
- DataRow.cs
- PreProcessor.cs
- XdrBuilder.cs
- followingquery.cs
- DesigntimeLicenseContext.cs
- RtType.cs
- CodeTypeConstructor.cs
- DBNull.cs
- XmlExpressionDumper.cs
- DiscoveryEndpoint.cs
- TranslateTransform3D.cs
- IsolatedStoragePermission.cs
- SpeakInfo.cs
- Selection.cs
- PropertyInformation.cs
- SystemIPGlobalProperties.cs
- DataTemplateKey.cs
- HttpRuntimeSection.cs
- TableLayoutRowStyleCollection.cs
- InertiaExpansionBehavior.cs
- ConfigurationManagerHelper.cs
- fixedPageContentExtractor.cs
- AuthenticationConfig.cs
- GPPOINT.cs
- Authorization.cs
- TimeSpanValidatorAttribute.cs
- ResourceManager.cs
- XmlSchema.cs
- MeasureItemEvent.cs
- System.Data.OracleClient_BID.cs
- DiagnosticTraceSource.cs
- SubordinateTransaction.cs
- XsdSchemaFileEditor.cs
- BinHexEncoder.cs
- TrimSurroundingWhitespaceAttribute.cs
- HandleCollector.cs
- AffineTransform3D.cs
- WebPart.cs
- WindowsToolbarItemAsMenuItem.cs
- messageonlyhwndwrapper.cs
- DataGridViewTextBoxCell.cs
- StrongNamePublicKeyBlob.cs
- CodeCatchClauseCollection.cs
- XmlWrappingWriter.cs
- DBCommandBuilder.cs
- MobileControl.cs
- AutomationPropertyInfo.cs
- WindowsListView.cs
- MarkupCompilePass2.cs
- ExpressionDumper.cs
- XmlCustomFormatter.cs
- IsolatedStorageFileStream.cs
- SQLChars.cs
- Unit.cs
- Style.cs
- SizeFConverter.cs
- AmbientLight.cs
- HttpClientCertificate.cs
- XPathChildIterator.cs
- CapabilitiesUse.cs
- ObjectRef.cs
- DragEvent.cs
- HttpServerProtocol.cs
- BamlResourceDeserializer.cs
- GeneralTransformCollection.cs
- PrePrepareMethodAttribute.cs
- XmlNodeChangedEventArgs.cs
- XPathEmptyIterator.cs
- RC2.cs
- EntityDesignerUtils.cs
- RemoteWebConfigurationHostStream.cs
- BindingExpression.cs
- SynchronousSendBindingElement.cs
- TypeSystemHelpers.cs
- Table.cs
- CodeParameterDeclarationExpressionCollection.cs
- HostUtils.cs
- _NativeSSPI.cs
- ControlValuePropertyAttribute.cs
- returneventsaver.cs
- EntityViewGenerationAttribute.cs
- DragDeltaEventArgs.cs
- RuntimeConfigurationRecord.cs
- x509utils.cs
- EntityDataSource.cs
- XmlILConstructAnalyzer.cs
- DeflateEmulationStream.cs
- GroupStyle.cs
- NativeMethods.cs
- ToolboxComponentsCreatingEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- NameTable.cs
- Main.cs