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
- SuppressMergeCheckAttribute.cs
- EventLogger.cs
- CharEnumerator.cs
- Span.cs
- Helpers.cs
- ProtocolsConfigurationEntry.cs
- SQLString.cs
- XmlSigningNodeWriter.cs
- ConcurrentStack.cs
- RawStylusSystemGestureInputReport.cs
- GridLength.cs
- EntityDataSourceWrapper.cs
- MobileContainerDesigner.cs
- TypeToken.cs
- PrintController.cs
- InvalidOperationException.cs
- CacheHelper.cs
- HttpWebRequest.cs
- StringFunctions.cs
- versioninfo.cs
- PersonalizablePropertyEntry.cs
- SymmetricKeyWrap.cs
- FontWeightConverter.cs
- XmlDeclaration.cs
- ReferenceConverter.cs
- EncodingNLS.cs
- BackgroundWorker.cs
- Util.cs
- InstrumentationTracker.cs
- DataException.cs
- BinaryExpression.cs
- DrawingState.cs
- ServiceDescription.cs
- InternalBase.cs
- EventLogEntryCollection.cs
- UntypedNullExpression.cs
- HashLookup.cs
- TextTreeTextBlock.cs
- PackWebRequestFactory.cs
- UnsafeNativeMethods.cs
- RegexRunner.cs
- CompileXomlTask.cs
- LayoutTableCell.cs
- ObjectIDGenerator.cs
- TextBoxBase.cs
- HGlobalSafeHandle.cs
- DependencyPropertyConverter.cs
- GridViewActionList.cs
- ListBoxChrome.cs
- ParameterModifier.cs
- AuthenticationServiceManager.cs
- URLAttribute.cs
- Grid.cs
- DataGridViewAdvancedBorderStyle.cs
- CatchBlock.cs
- UrlRoutingModule.cs
- XNodeNavigator.cs
- InputProcessorProfiles.cs
- PictureBox.cs
- HostSecurityManager.cs
- ItemType.cs
- dataSvcMapFileLoader.cs
- ServiceTimeoutsElement.cs
- PhysicalOps.cs
- PersonalizationProviderHelper.cs
- EditorAttribute.cs
- COSERVERINFO.cs
- BaseAddressPrefixFilterElementCollection.cs
- IMembershipProvider.cs
- StringFunctions.cs
- PKCS1MaskGenerationMethod.cs
- WorkingDirectoryEditor.cs
- Rijndael.cs
- ContextProperty.cs
- XPathNavigator.cs
- XmlDictionaryString.cs
- DiffuseMaterial.cs
- ColorBlend.cs
- Screen.cs
- WorkflowOperationBehavior.cs
- QueryContext.cs
- MatrixAnimationUsingPath.cs
- XmlNodeReader.cs
- NumberSubstitution.cs
- ConfigurationManager.cs
- XsltCompileContext.cs
- GlobalizationSection.cs
- EntryPointNotFoundException.cs
- InternalDuplexChannelFactory.cs
- PerformanceCounterCategory.cs
- AuthenticatedStream.cs
- MouseCaptureWithinProperty.cs
- SafeCryptContextHandle.cs
- ContentValidator.cs
- MobileControlsSection.cs
- AppSettingsReader.cs
- LoadWorkflowByKeyAsyncResult.cs
- XXXOnTypeBuilderInstantiation.cs
- RequiredAttributeAttribute.cs
- AuthStoreRoleProvider.cs