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
- AliasedSlot.cs
- MemoryPressure.cs
- ChameleonKey.cs
- DataStreamFromComStream.cs
- EventRecord.cs
- MsmqProcessProtocolHandler.cs
- SingleObjectCollection.cs
- DataGridViewMethods.cs
- CodeMemberEvent.cs
- TraceSection.cs
- BuilderPropertyEntry.cs
- ListDictionaryInternal.cs
- SystemIPv6InterfaceProperties.cs
- DomainUpDown.cs
- ControlCachePolicy.cs
- ClientSideProviderDescription.cs
- Propagator.cs
- AttributeEmitter.cs
- RequestCachePolicyConverter.cs
- XhtmlBasicTextViewAdapter.cs
- DisplayMemberTemplateSelector.cs
- WebPartZoneBaseDesigner.cs
- FilteredDataSetHelper.cs
- XamlTypeMapperSchemaContext.cs
- SystemDropShadowChrome.cs
- IPCCacheManager.cs
- AssemblyGen.cs
- Setter.cs
- UniqueEventHelper.cs
- EdmFunctions.cs
- DragEvent.cs
- SequenceRangeCollection.cs
- KeyGestureValueSerializer.cs
- SubclassTypeValidatorAttribute.cs
- AsyncContentLoadedEventArgs.cs
- PropertyChangedEventArgs.cs
- OdbcConnectionPoolProviderInfo.cs
- ProjectionPathSegment.cs
- XPathMultyIterator.cs
- TemplateInstanceAttribute.cs
- FontFaceLayoutInfo.cs
- IpcClientChannel.cs
- BrowserCapabilitiesFactoryBase.cs
- DataGridViewCellParsingEventArgs.cs
- ImpersonateTokenRef.cs
- Int64KeyFrameCollection.cs
- HtmlTitle.cs
- WebContext.cs
- RowType.cs
- DSACryptoServiceProvider.cs
- ProcessModelSection.cs
- TransformerTypeCollection.cs
- FileStream.cs
- ValidationPropertyAttribute.cs
- NonClientArea.cs
- DecodeHelper.cs
- DeleteMemberBinder.cs
- BinaryObjectInfo.cs
- CatalogPart.cs
- BindingWorker.cs
- DataTableNewRowEvent.cs
- XNodeValidator.cs
- MergeExecutor.cs
- CursorConverter.cs
- BlurEffect.cs
- XsltContext.cs
- CollectionView.cs
- MailWriter.cs
- TextServicesPropertyRanges.cs
- WmlSelectionListAdapter.cs
- RichTextBoxConstants.cs
- XPathSingletonIterator.cs
- SchemaReference.cs
- BuildManager.cs
- ObfuscationAttribute.cs
- CrossContextChannel.cs
- InheritanceRules.cs
- SchemaExporter.cs
- ProfilePropertyMetadata.cs
- DataSourceGroupCollection.cs
- AnonymousIdentificationModule.cs
- IdentifierService.cs
- HttpModuleActionCollection.cs
- DriveNotFoundException.cs
- MatrixAnimationUsingKeyFrames.cs
- FullTextState.cs
- SqlGenericUtil.cs
- DefaultParameterValueAttribute.cs
- Clause.cs
- StoreUtilities.cs
- RedBlackList.cs
- cookieexception.cs
- BitmapEffectRenderDataResource.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- Point4D.cs
- RegionData.cs
- UnsafeNativeMethods.cs
- QuotedPrintableStream.cs
- AllMembershipCondition.cs
- TextSelectionHighlightLayer.cs