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
- Roles.cs
- StorageMappingFragment.cs
- DragDrop.cs
- ScriptManagerProxy.cs
- IxmlLineInfo.cs
- AssociationSetMetadata.cs
- AlphabeticalEnumConverter.cs
- ObjectAnimationUsingKeyFrames.cs
- BitmapEffectOutputConnector.cs
- TextFormatter.cs
- DbConnectionPoolOptions.cs
- HtmlShimManager.cs
- Int32EqualityComparer.cs
- StringSorter.cs
- GridViewCellAutomationPeer.cs
- XmlHierarchicalDataSourceView.cs
- PauseStoryboard.cs
- InvalidAsynchronousStateException.cs
- TextFragmentEngine.cs
- SqlConnectionPoolProviderInfo.cs
- Rotation3DKeyFrameCollection.cs
- KeySpline.cs
- Privilege.cs
- HwndTarget.cs
- EventLogEntryCollection.cs
- DecimalAnimationBase.cs
- Globals.cs
- TaiwanLunisolarCalendar.cs
- AuthStoreRoleProvider.cs
- Visitor.cs
- NegatedCellConstant.cs
- ImageMapEventArgs.cs
- manifestimages.cs
- Pen.cs
- Stylesheet.cs
- Vector.cs
- ObjectQueryExecutionPlan.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- DrawItemEvent.cs
- StylusEventArgs.cs
- TargetInvocationException.cs
- TemplateControl.cs
- ThousandthOfEmRealPoints.cs
- TextSpan.cs
- VSWCFServiceContractGenerator.cs
- CustomAssemblyResolver.cs
- WizardStepBase.cs
- PreloadedPackages.cs
- DoubleAnimationClockResource.cs
- ButtonPopupAdapter.cs
- ExpressionDumper.cs
- OdbcConnectionOpen.cs
- SvcMapFile.cs
- PenContexts.cs
- DbDataRecord.cs
- ToolTip.cs
- OrderedDictionaryStateHelper.cs
- CatalogZoneBase.cs
- BamlLocalizableResource.cs
- DesignerObject.cs
- ValidationManager.cs
- WorkflowRuntimeElement.cs
- ProtocolViolationException.cs
- WindowsToolbarItemAsMenuItem.cs
- StructuralObject.cs
- BitmapFrame.cs
- DictionaryEntry.cs
- TextTreeUndoUnit.cs
- SimpleRecyclingCache.cs
- FrugalMap.cs
- UrlMapping.cs
- ColorConvertedBitmap.cs
- XmlDocumentSerializer.cs
- SqlVersion.cs
- ConfigurationLockCollection.cs
- SqlDataSourceCommandEventArgs.cs
- SafeLibraryHandle.cs
- Encoder.cs
- HttpTransportManager.cs
- XmlHierarchyData.cs
- DesignRelationCollection.cs
- ResourceProviderFactory.cs
- Query.cs
- EncryptedKey.cs
- SyndicationElementExtension.cs
- RtfToXamlReader.cs
- XPathScanner.cs
- XmlSchemaSubstitutionGroup.cs
- OdbcCommand.cs
- FunctionParameter.cs
- EventMap.cs
- BaseAsyncResult.cs
- WebDescriptionAttribute.cs
- DataGridRow.cs
- XmlException.cs
- PointUtil.cs
- ReleaseInstanceMode.cs
- SqlReorderer.cs
- DataPagerFieldItem.cs
- QilPatternFactory.cs