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
- UIElementIsland.cs
- TypeDescriptionProviderAttribute.cs
- SystemColors.cs
- PolyLineSegment.cs
- loginstatus.cs
- SequenceDesignerAccessibleObject.cs
- CharacterBuffer.cs
- PageBreakRecord.cs
- HideDisabledControlAdapter.cs
- ProcessModelInfo.cs
- HtmlInputFile.cs
- DataGridPagerStyle.cs
- Page.cs
- XmlSchemaParticle.cs
- MultiSelectRootGridEntry.cs
- CornerRadius.cs
- ContainerParaClient.cs
- SqlRetyper.cs
- SchemaImporter.cs
- XmlAttributeAttribute.cs
- HuffCodec.cs
- DoubleAnimationBase.cs
- CustomCategoryAttribute.cs
- OverrideMode.cs
- InternalException.cs
- _NegoStream.cs
- SchemaElementLookUpTable.cs
- PeerCollaborationPermission.cs
- ILGenerator.cs
- DataGridViewBand.cs
- DiscoveryClientRequestChannel.cs
- SurrogateChar.cs
- NavigationService.cs
- LinearGradientBrush.cs
- JsonUriDataContract.cs
- GCHandleCookieTable.cs
- SqlConnectionString.cs
- VerticalAlignConverter.cs
- MimeBasePart.cs
- Keywords.cs
- PropertyEmitterBase.cs
- DesignRelationCollection.cs
- ConstructorBuilder.cs
- NotifyParentPropertyAttribute.cs
- _RequestCacheProtocol.cs
- PrivilegedConfigurationManager.cs
- sqlpipe.cs
- RelAssertionDirectKeyIdentifierClause.cs
- RangeValidator.cs
- xmlglyphRunInfo.cs
- PreviewControlDesigner.cs
- HandleRef.cs
- LoginUtil.cs
- ResourceSetExpression.cs
- TextRunProperties.cs
- XmlQueryCardinality.cs
- ResolveDuplexCD1AsyncResult.cs
- RegistrySecurity.cs
- BaseComponentEditor.cs
- ChannelSinkStacks.cs
- ToolStripDropDownMenu.cs
- HttpModuleCollection.cs
- MailDefinition.cs
- ParameterToken.cs
- DefaultPropertyAttribute.cs
- QilInvoke.cs
- FixedDocument.cs
- IndentedTextWriter.cs
- SessionChannels.cs
- BinaryReader.cs
- ToolStripPanelSelectionBehavior.cs
- ListViewUpdateEventArgs.cs
- HostingEnvironmentException.cs
- RectangleHotSpot.cs
- PopupEventArgs.cs
- SoapInteropTypes.cs
- GeneratedContractType.cs
- FileSystemEventArgs.cs
- DataGridLinkButton.cs
- FileDataSourceCache.cs
- SubpageParagraph.cs
- SchemaCollectionPreprocessor.cs
- UIPermission.cs
- EventProperty.cs
- Vector3DValueSerializer.cs
- EntityViewContainer.cs
- BulletChrome.cs
- HtmlInputSubmit.cs
- InsufficientMemoryException.cs
- SqlClientMetaDataCollectionNames.cs
- ManipulationDeltaEventArgs.cs
- DependencyObjectPropertyDescriptor.cs
- Shared.cs
- Operand.cs
- Axis.cs
- EventMap.cs
- FileEnumerator.cs
- DataSourceCache.cs
- WindowAutomationPeer.cs
- ContextBase.cs