Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- UnconditionalPolicy.cs
- Graphics.cs
- WebScriptEndpointElement.cs
- DependencyPropertyChangedEventArgs.cs
- MetaTableHelper.cs
- CancellationTokenRegistration.cs
- XmlILStorageConverter.cs
- ClientRoleProvider.cs
- AstNode.cs
- WindowsServiceElement.cs
- BitmapDecoder.cs
- XsltOutput.cs
- CodeDirectoryCompiler.cs
- SafeCancelMibChangeNotify.cs
- AssemblyAttributesGoHere.cs
- DivideByZeroException.cs
- DataGridHeaderBorder.cs
- AttributeUsageAttribute.cs
- ButtonBase.cs
- SqlStream.cs
- HebrewCalendar.cs
- ReferenceTypeElement.cs
- FrameDimension.cs
- HttpRuntimeSection.cs
- IntSecurity.cs
- SkinBuilder.cs
- Resources.Designer.cs
- UnrecognizedAssertionsBindingElement.cs
- SystemResourceKey.cs
- DocumentationServerProtocol.cs
- TableRowCollection.cs
- InvokeCompletedEventArgs.cs
- AnimationException.cs
- ViewStateModeByIdAttribute.cs
- Scripts.cs
- WebPartCatalogAddVerb.cs
- CodeGenHelper.cs
- DiscoveryClientDocuments.cs
- Permission.cs
- TextProperties.cs
- RepeatInfo.cs
- DataServiceQuery.cs
- DrawingContextDrawingContextWalker.cs
- ProfessionalColors.cs
- WebRequestModulesSection.cs
- QueryableDataSource.cs
- HtmlControlDesigner.cs
- CatalogPartCollection.cs
- HyperLinkField.cs
- OleDbCommand.cs
- PeerCredentialElement.cs
- SystemMulticastIPAddressInformation.cs
- NoPersistScope.cs
- ControlIdConverter.cs
- TrackingServices.cs
- TreeViewEvent.cs
- ListBoxItemWrapperAutomationPeer.cs
- nulltextnavigator.cs
- SyndicationDeserializer.cs
- XmlWellformedWriter.cs
- BinaryObjectInfo.cs
- OletxEnlistment.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- ISAPIRuntime.cs
- HttpValueCollection.cs
- CodeStatementCollection.cs
- Repeater.cs
- DEREncoding.cs
- MonthChangedEventArgs.cs
- HtmlImage.cs
- GeneralTransformGroup.cs
- CngAlgorithmGroup.cs
- CompiledELinqQueryState.cs
- SequentialActivityDesigner.cs
- LabelLiteral.cs
- ClockGroup.cs
- WindowsStatic.cs
- ListBox.cs
- PartialClassGenerationTask.cs
- CodeTypeMemberCollection.cs
- Menu.cs
- ResponseStream.cs
- MachineKeyValidationConverter.cs
- DeviceContext.cs
- ComplexTypeEmitter.cs
- PropertyDescriptorCollection.cs
- QueryStringParameter.cs
- ThemeInfoAttribute.cs
- LightweightCodeGenerator.cs
- LogReservationCollection.cs
- WindowsListViewGroupSubsetLink.cs
- Constraint.cs
- GlyphManager.cs
- FrameDimension.cs
- EUCJPEncoding.cs
- _ListenerAsyncResult.cs
- EnterpriseServicesHelper.cs
- WebFaultClientMessageInspector.cs
- MemberRelationshipService.cs
- shaperfactoryquerycacheentry.cs