Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- WSSecurityTokenSerializer.cs
- Int32CAMarshaler.cs
- ValuePattern.cs
- ListInitExpression.cs
- TemplateControlCodeDomTreeGenerator.cs
- InvalidProgramException.cs
- ExceptionRoutedEventArgs.cs
- StyleHelper.cs
- SystemNetHelpers.cs
- iisPickupDirectory.cs
- ValidationErrorCollection.cs
- PageCache.cs
- FactoryGenerator.cs
- SqlProcedureAttribute.cs
- DefaultHttpHandler.cs
- iisPickupDirectory.cs
- StylusButtonEventArgs.cs
- DiagnosticTraceSource.cs
- PropertyPushdownHelper.cs
- DbConnectionHelper.cs
- AuthenticationSection.cs
- ExpressionBuilderContext.cs
- DockPanel.cs
- _NetworkingPerfCounters.cs
- PackageFilter.cs
- XPathQueryGenerator.cs
- DependencyObject.cs
- WindowsFormsSynchronizationContext.cs
- SamlConstants.cs
- DesignTimeType.cs
- WSTrustDec2005.cs
- XhtmlBasicTextBoxAdapter.cs
- Rect3D.cs
- BufferedGraphics.cs
- FieldNameLookup.cs
- Evidence.cs
- WebRequestModuleElement.cs
- SQLInt64.cs
- OleDbEnumerator.cs
- StylusShape.cs
- TimeSpanStorage.cs
- CodeTypeOfExpression.cs
- Config.cs
- ThemeInfoAttribute.cs
- ButtonChrome.cs
- ProfileGroupSettings.cs
- DockAndAnchorLayout.cs
- ipaddressinformationcollection.cs
- FileDialog.cs
- ValidatorCollection.cs
- DictionaryEntry.cs
- ConfigurationManager.cs
- ArrayTypeMismatchException.cs
- Resources.Designer.cs
- DataGridViewLayoutData.cs
- filewebresponse.cs
- CodeDomLoader.cs
- ProcessThread.cs
- ConfigDefinitionUpdates.cs
- xmlsaver.cs
- SamlConditions.cs
- VisualStates.cs
- DesignerForm.cs
- GeneratedCodeAttribute.cs
- CryptoConfig.cs
- Byte.cs
- Privilege.cs
- XMLDiffLoader.cs
- CreateUserErrorEventArgs.cs
- TextElementEditingBehaviorAttribute.cs
- WebScriptClientGenerator.cs
- LifetimeServices.cs
- QueryStringHandler.cs
- StylusButtonCollection.cs
- ResourceAttributes.cs
- XmlDataImplementation.cs
- TextServicesHost.cs
- TextMarkerSource.cs
- DropAnimation.xaml.cs
- DrawingDrawingContext.cs
- ConvertTextFrag.cs
- GlobalDataBindingHandler.cs
- DragCompletedEventArgs.cs
- RuleSetBrowserDialog.cs
- ipaddressinformationcollection.cs
- MetadataUtilsSmi.cs
- DrawingGroup.cs
- DoubleConverter.cs
- VScrollProperties.cs
- ControlEvent.cs
- PeerDuplexChannelListener.cs
- Margins.cs
- ProgressChangedEventArgs.cs
- DataGridViewCellValueEventArgs.cs
- PropertyNames.cs
- NativeRightsManagementAPIsStructures.cs
- ThaiBuddhistCalendar.cs
- PageTheme.cs
- DataSourceHelper.cs
- DataGridCellEditEndingEventArgs.cs