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
- PrePrepareMethodAttribute.cs
- LeafCellTreeNode.cs
- PropertyDescriptorComparer.cs
- SqlRewriteScalarSubqueries.cs
- RuntimeHandles.cs
- CertificateManager.cs
- XmlSchemaAnnotation.cs
- SqlBulkCopy.cs
- RotationValidation.cs
- IssuedTokenServiceCredential.cs
- NetSectionGroup.cs
- InfoCardProofToken.cs
- FtpRequestCacheValidator.cs
- TreeView.cs
- processwaithandle.cs
- ObjectRef.cs
- CustomMenuItemCollection.cs
- InternalsVisibleToAttribute.cs
- ResourcePermissionBase.cs
- DockProviderWrapper.cs
- InteropExecutor.cs
- EventArgs.cs
- TypeForwardedToAttribute.cs
- RichTextBoxConstants.cs
- Atom10FormatterFactory.cs
- LayoutTableCell.cs
- DecimalStorage.cs
- FramingChannels.cs
- ViewDesigner.cs
- ModuleElement.cs
- XmlReader.cs
- ScriptControlManager.cs
- StickyNoteHelper.cs
- SqlGatherProducedAliases.cs
- SerializableTypeCodeDomSerializer.cs
- CdpEqualityComparer.cs
- SimpleWebHandlerParser.cs
- Grid.cs
- TypeExtensions.cs
- InvalidStoreProtectionKeyException.cs
- MultiBindingExpression.cs
- RtfControls.cs
- Margins.cs
- ManagementExtension.cs
- ChildDocumentBlock.cs
- Animatable.cs
- DbProviderFactories.cs
- DescriptionAttribute.cs
- ParserExtension.cs
- XsltContext.cs
- ClientSponsor.cs
- StrokeSerializer.cs
- WebBrowserSiteBase.cs
- InstanceView.cs
- x509store.cs
- RuleProcessor.cs
- CombinedGeometry.cs
- SplitterCancelEvent.cs
- TableAdapterManagerMethodGenerator.cs
- XmlEntityReference.cs
- ListViewInsertEventArgs.cs
- List.cs
- MasterPage.cs
- WebPartCollection.cs
- WorkflowInlining.cs
- SchemaTypeEmitter.cs
- SizeValueSerializer.cs
- ImportContext.cs
- EmptyQuery.cs
- ColumnClickEvent.cs
- DesignTimeParseData.cs
- EventSinkHelperWriter.cs
- XPathSelfQuery.cs
- StringFormat.cs
- RequestResizeEvent.cs
- NavigationHelper.cs
- ClientTarget.cs
- DetailsView.cs
- AsymmetricKeyExchangeFormatter.cs
- HttpRawResponse.cs
- SettingsBindableAttribute.cs
- DiffuseMaterial.cs
- StoreAnnotationsMap.cs
- XPathAncestorIterator.cs
- AutomationPatternInfo.cs
- LambdaCompiler.Address.cs
- ConnectionPoolRegistry.cs
- InlinedAggregationOperator.cs
- ToolStripLabel.cs
- DataGridViewRow.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- MobileControlDesigner.cs
- XmlSchemaSimpleTypeRestriction.cs
- CommandBinding.cs
- SpotLight.cs
- StylusSystemGestureEventArgs.cs
- NonClientArea.cs
- XmlDomTextWriter.cs
- UnsafeNativeMethods.cs
- Point4D.cs