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
- Condition.cs
- CodeSnippetStatement.cs
- Persist.cs
- OdbcParameterCollection.cs
- recordstatefactory.cs
- SpotLight.cs
- MaskedTextBox.cs
- WindowsFont.cs
- CodeConditionStatement.cs
- NestedContainer.cs
- Renderer.cs
- FontSizeConverter.cs
- GridViewDeleteEventArgs.cs
- Attributes.cs
- AspProxy.cs
- COM2Properties.cs
- SoapHeaderException.cs
- CodeTypeMember.cs
- PersonalizationProvider.cs
- COM2FontConverter.cs
- TextParagraph.cs
- CleanUpVirtualizedItemEventArgs.cs
- ByteBufferPool.cs
- SQLMoney.cs
- Normalization.cs
- MessageEncodingBindingElement.cs
- EarlyBoundInfo.cs
- PrintPreviewControl.cs
- ThreadInterruptedException.cs
- TextSpan.cs
- HashAlgorithm.cs
- SweepDirectionValidation.cs
- ServiceBusyException.cs
- XmlSerializationGeneratedCode.cs
- PtsCache.cs
- StringAttributeCollection.cs
- _ScatterGatherBuffers.cs
- LinqDataSourceView.cs
- ObjectDataSourceMethodEventArgs.cs
- SoapSchemaExporter.cs
- FixedDocument.cs
- ScaleTransform.cs
- CodeAttributeDeclarationCollection.cs
- DataBinding.cs
- NamedPermissionSet.cs
- DesignerOptionService.cs
- CodeSnippetCompileUnit.cs
- basevalidator.cs
- Material.cs
- ColumnTypeConverter.cs
- LongTypeConverter.cs
- GroupBox.cs
- ArglessEventHandlerProxy.cs
- IndependentAnimationStorage.cs
- ScriptModule.cs
- ResourcePool.cs
- MergablePropertyAttribute.cs
- DataGridViewBindingCompleteEventArgs.cs
- TypeViewSchema.cs
- WebPartsPersonalizationAuthorization.cs
- StdValidatorsAndConverters.cs
- CodeParameterDeclarationExpressionCollection.cs
- CodeDOMProvider.cs
- ColumnTypeConverter.cs
- EDesignUtil.cs
- XmlSiteMapProvider.cs
- CheckBoxList.cs
- cookiecollection.cs
- IISMapPath.cs
- SegmentInfo.cs
- XmlSerializer.cs
- WsatAdminException.cs
- AppSettingsExpressionBuilder.cs
- QilStrConcatenator.cs
- XmlSerializerVersionAttribute.cs
- MetafileHeaderWmf.cs
- ListBindingHelper.cs
- XPathSelectionIterator.cs
- PagedDataSource.cs
- FormsAuthenticationTicket.cs
- HandlerFactoryCache.cs
- DependencyProperty.cs
- CheckBox.cs
- NCryptSafeHandles.cs
- ListControl.cs
- InvokePattern.cs
- SafeNativeMethodsCLR.cs
- Publisher.cs
- TextContainer.cs
- BuildProviderAppliesToAttribute.cs
- SchemaElement.cs
- BoundPropertyEntry.cs
- TiffBitmapDecoder.cs
- ImageBrush.cs
- FormView.cs
- HttpListener.cs
- ProofTokenCryptoHandle.cs
- XamlTemplateSerializer.cs
- SecondaryViewProvider.cs
- UndoEngine.cs