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
- MailMessage.cs
- Row.cs
- GridViewRowCollection.cs
- HostedImpersonationContext.cs
- WebPartTransformer.cs
- InputReport.cs
- CodeExporter.cs
- path.cs
- WizardPanel.cs
- Block.cs
- WebZone.cs
- URIFormatException.cs
- ContentValidator.cs
- SystemMulticastIPAddressInformation.cs
- ToolStripScrollButton.cs
- CFGGrammar.cs
- DivideByZeroException.cs
- SystemNetHelpers.cs
- Perspective.cs
- RawMouseInputReport.cs
- Encoder.cs
- DataGridRowAutomationPeer.cs
- InvokePattern.cs
- SqlDataSourceCache.cs
- AdCreatedEventArgs.cs
- PointHitTestResult.cs
- EntityContainerEntitySetDefiningQuery.cs
- NumberFunctions.cs
- IgnoreSection.cs
- PointLight.cs
- Span.cs
- StyleModeStack.cs
- XmlChoiceIdentifierAttribute.cs
- XmlSchemaSimpleTypeRestriction.cs
- ResourceDescriptionAttribute.cs
- FilterableAttribute.cs
- TrustLevelCollection.cs
- DataRowView.cs
- SecUtil.cs
- ForceCopyBuildProvider.cs
- AuthenticateEventArgs.cs
- Types.cs
- Keywords.cs
- Assert.cs
- QuinticEase.cs
- ProxyFragment.cs
- ViewManager.cs
- SqlGenericUtil.cs
- DefaultPropertyAttribute.cs
- SecurityUtils.cs
- EastAsianLunisolarCalendar.cs
- Pair.cs
- Function.cs
- SystemException.cs
- IpcServerChannel.cs
- FilteredXmlReader.cs
- CapabilitiesAssignment.cs
- DictionaryManager.cs
- LinqDataSource.cs
- ToolStripManager.cs
- ConstantExpression.cs
- Font.cs
- SamlConditions.cs
- CreateParams.cs
- MessageContractAttribute.cs
- XmlWriter.cs
- CompilationSection.cs
- WebPartVerbCollection.cs
- RawStylusActions.cs
- SqlFacetAttribute.cs
- BindingManagerDataErrorEventArgs.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- SerializableAttribute.cs
- XmlProcessingInstruction.cs
- Operand.cs
- DataShape.cs
- CellIdBoolean.cs
- ListBindableAttribute.cs
- GPPOINTF.cs
- Compilation.cs
- DocumentApplicationJournalEntryEventArgs.cs
- xsdvalidator.cs
- TimelineClockCollection.cs
- EventDescriptor.cs
- ObjectParameterCollection.cs
- _ConnectOverlappedAsyncResult.cs
- DescriptionAttribute.cs
- DeflateStream.cs
- QuadraticBezierSegment.cs
- X509ChainElement.cs
- ZipIOExtraFieldPaddingElement.cs
- ThemeDirectoryCompiler.cs
- TextContainerChangeEventArgs.cs
- CompilerInfo.cs
- DrawingAttributesDefaultValueFactory.cs
- FunctionNode.cs
- System.Data.OracleClient_BID.cs
- DataObject.cs
- LineGeometry.cs
- LogLogRecordHeader.cs