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
- MachinePropertyVariants.cs
- ExternalException.cs
- BitmapEffectRenderDataResource.cs
- CompilerInfo.cs
- EntityContainerEmitter.cs
- Comparer.cs
- NativeMethods.cs
- XmlAttributeCollection.cs
- XPathException.cs
- ObjectTypeMapping.cs
- HyperLinkStyle.cs
- PrintDocument.cs
- OdbcCommand.cs
- SQLGuidStorage.cs
- ConfigurationManagerInternalFactory.cs
- ControlCachePolicy.cs
- MultiBinding.cs
- CodeCatchClauseCollection.cs
- MemberDescriptor.cs
- StylusPointCollection.cs
- SecurityKeyType.cs
- SafeFileHandle.cs
- ToolStripArrowRenderEventArgs.cs
- MenuBindingsEditorForm.cs
- xmlfixedPageInfo.cs
- initElementDictionary.cs
- InternalBufferOverflowException.cs
- LoginDesignerUtil.cs
- UrlPath.cs
- XmlEncoding.cs
- ToolStripSplitStackLayout.cs
- ObfuscateAssemblyAttribute.cs
- SpellerStatusTable.cs
- MetadataItemCollectionFactory.cs
- userdatakeys.cs
- MatrixIndependentAnimationStorage.cs
- ListBoxItem.cs
- BrowserCapabilitiesFactory.cs
- TableItemStyle.cs
- _OSSOCK.cs
- SchemaElementLookUpTable.cs
- DetailsViewPagerRow.cs
- ApplicationSecurityManager.cs
- HtmlForm.cs
- CapabilitiesRule.cs
- x509store.cs
- BasicHttpSecurityElement.cs
- TraversalRequest.cs
- XmlEncoding.cs
- AppSettingsSection.cs
- Schema.cs
- Context.cs
- IInstanceContextProvider.cs
- GeneratedView.cs
- isolationinterop.cs
- ColumnResult.cs
- EntityDataSourceSelectingEventArgs.cs
- SystemInfo.cs
- UInt32Converter.cs
- BamlTreeUpdater.cs
- InvalidCastException.cs
- FontDialog.cs
- XmlLoader.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- HtmlImage.cs
- ReturnType.cs
- HandlerWithFactory.cs
- StaticFileHandler.cs
- ProtocolElementCollection.cs
- ToolBarOverflowPanel.cs
- ProvidePropertyAttribute.cs
- ColumnWidthChangingEvent.cs
- IpcChannelHelper.cs
- SmtpFailedRecipientsException.cs
- XPathDescendantIterator.cs
- SettingsSection.cs
- FileLoadException.cs
- ColumnBinding.cs
- XamlToRtfWriter.cs
- NativeRightsManagementAPIsStructures.cs
- M3DUtil.cs
- CodeDomConfigurationHandler.cs
- Triangle.cs
- ToolStripMenuItemCodeDomSerializer.cs
- RefreshEventArgs.cs
- TabOrder.cs
- EnumUnknown.cs
- TableDesigner.cs
- LocalizableAttribute.cs
- CultureInfo.cs
- KeySpline.cs
- TransformerInfoCollection.cs
- ContentDisposition.cs
- ClientSideQueueItem.cs
- PageHandlerFactory.cs
- ThicknessKeyFrameCollection.cs
- DataGridViewRowConverter.cs
- TypeBuilder.cs
- Serializer.cs
- OracleParameterCollection.cs