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
- TypeFieldSchema.cs
- DbRetry.cs
- ImageAttributes.cs
- WebConfigurationHostFileChange.cs
- RegistrationServices.cs
- HtmlInputText.cs
- DesignerSerializationOptionsAttribute.cs
- ErrorTableItemStyle.cs
- compensatingcollection.cs
- XmlSchemaInferenceException.cs
- DataGridViewRowsAddedEventArgs.cs
- ItemCheckEvent.cs
- XmlFormatWriterGenerator.cs
- UnknownMessageReceivedEventArgs.cs
- ToolBar.cs
- ResourceReferenceKeyNotFoundException.cs
- RegularExpressionValidator.cs
- UnionCodeGroup.cs
- WinEventWrap.cs
- CategoryNameCollection.cs
- PostBackOptions.cs
- SimplePropertyEntry.cs
- CultureInfo.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- InvalidPropValue.cs
- StateInitializationDesigner.cs
- StyleCollection.cs
- Style.cs
- AddressUtility.cs
- WebSysDefaultValueAttribute.cs
- VBIdentifierTrimConverter.cs
- SessionState.cs
- SafeSecurityHandles.cs
- CustomErrorCollection.cs
- DBCommandBuilder.cs
- BasePropertyDescriptor.cs
- ExpressionsCollectionEditor.cs
- ISAPIRuntime.cs
- CustomCategoryAttribute.cs
- TreeNode.cs
- DataSpaceManager.cs
- DataGridColumnDropSeparator.cs
- CannotUnloadAppDomainException.cs
- IntellisenseTextBox.cs
- SizeKeyFrameCollection.cs
- FileDataSourceCache.cs
- EntityDataSourceMemberPath.cs
- CustomErrorsSection.cs
- AnnouncementService.cs
- SqlTypesSchemaImporter.cs
- TemplateEditingVerb.cs
- SystemIPv4InterfaceProperties.cs
- ArraySubsetEnumerator.cs
- SerialStream.cs
- DatePickerDateValidationErrorEventArgs.cs
- FtpCachePolicyElement.cs
- DirectoryNotFoundException.cs
- Site.cs
- CodeTypeOfExpression.cs
- OleDbStruct.cs
- CorrelationQueryBehavior.cs
- DrawingContextWalker.cs
- DocumentPaginator.cs
- SchemaManager.cs
- CfgParser.cs
- Stylus.cs
- RIPEMD160.cs
- AutomationPatternInfo.cs
- ConfigXmlComment.cs
- NamedElement.cs
- XmlBoundElement.cs
- ObjectStateFormatter.cs
- PageRouteHandler.cs
- LinkLabelLinkClickedEvent.cs
- SuspendDesigner.cs
- CustomErrorCollection.cs
- TaiwanCalendar.cs
- MailWebEventProvider.cs
- SwitchElementsCollection.cs
- HtmlButton.cs
- TypedReference.cs
- PngBitmapDecoder.cs
- Drawing.cs
- ToolStripTemplateNode.cs
- RadioButtonList.cs
- NotifyCollectionChangedEventArgs.cs
- ArrayExtension.cs
- ExpressionConverter.cs
- SequentialOutput.cs
- XmlCompatibilityReader.cs
- RepeaterItemEventArgs.cs
- MsmqIntegrationBindingElement.cs
- ToolboxItemFilterAttribute.cs
- SR.cs
- ContentAlignmentEditor.cs
- RadioButtonDesigner.cs
- HitTestWithGeometryDrawingContextWalker.cs
- Simplifier.cs
- VirtualPath.cs
- Point3DCollection.cs