Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- XPathNavigatorKeyComparer.cs
- CollectionType.cs
- SignedXml.cs
- DragEvent.cs
- EDesignUtil.cs
- SerTrace.cs
- PrintDialog.cs
- DateTimeValueSerializer.cs
- GlobalProxySelection.cs
- TypeInformation.cs
- ComPlusDiagnosticTraceSchemas.cs
- TypeSystemProvider.cs
- TimeZoneNotFoundException.cs
- SR.Designer.cs
- MeasurementDCInfo.cs
- EntityDesignerBuildProvider.cs
- ArcSegment.cs
- CalendarAutomationPeer.cs
- HostedTransportConfigurationBase.cs
- HttpCapabilitiesSectionHandler.cs
- XmlTextReaderImplHelpers.cs
- CategoryValueConverter.cs
- NotifyCollectionChangedEventArgs.cs
- XmlSchemaException.cs
- RoleGroupCollection.cs
- CodeNamespace.cs
- CompilationUtil.cs
- DataFieldCollectionEditor.cs
- PresentationSource.cs
- TreeView.cs
- TcpTransportBindingElement.cs
- TextSearch.cs
- Operator.cs
- TraceLevelStore.cs
- SectionUpdates.cs
- PrintEvent.cs
- TreeViewImageIndexConverter.cs
- InvokeGenerator.cs
- TokenBasedSet.cs
- DrawingImage.cs
- BitmapEffectInput.cs
- SeparatorAutomationPeer.cs
- EdmPropertyAttribute.cs
- MobileUserControl.cs
- TcpProcessProtocolHandler.cs
- XmlUtil.cs
- TimerEventSubscriptionCollection.cs
- TabControl.cs
- EncryptedPackageFilter.cs
- EventHandlersStore.cs
- WindowsStatusBar.cs
- KeyGestureValueSerializer.cs
- DataGridItem.cs
- FormView.cs
- PersonalizationStateInfo.cs
- ScriptServiceAttribute.cs
- IconBitmapDecoder.cs
- CellParagraph.cs
- WorkflowMarkupSerializationProvider.cs
- CompilerTypeWithParams.cs
- DBConnectionString.cs
- GACMembershipCondition.cs
- Keywords.cs
- SafeNativeMethods.cs
- SessionKeyExpiredException.cs
- ObjectItemLoadingSessionData.cs
- ReachNamespaceInfo.cs
- LoginViewDesigner.cs
- util.cs
- EntityCommandDefinition.cs
- GridLengthConverter.cs
- ModelItemImpl.cs
- TripleDES.cs
- Path.cs
- ProfilePropertySettingsCollection.cs
- Set.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- FreeFormDesigner.cs
- GroupQuery.cs
- PageStatePersister.cs
- PartialArray.cs
- RegexCompilationInfo.cs
- ChannelServices.cs
- AssemblyBuilderData.cs
- RegexRunner.cs
- RequiredAttributeAttribute.cs
- TimerEventSubscriptionCollection.cs
- TemplateControlCodeDomTreeGenerator.cs
- TableCellCollection.cs
- FormsAuthenticationModule.cs
- XPathBinder.cs
- OleServicesContext.cs
- OleDbParameter.cs
- PropertyStore.cs
- XmlLangPropertyAttribute.cs
- UriScheme.cs
- PinnedBufferMemoryStream.cs
- HashAlgorithm.cs
- PartitionerQueryOperator.cs
- LicenseManager.cs