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
- WmlPhoneCallAdapter.cs
- VisualStyleTypesAndProperties.cs
- Win32.cs
- StringInfo.cs
- SessionPageStateSection.cs
- SecUtil.cs
- ControlPaint.cs
- TcpHostedTransportConfiguration.cs
- ConfigurationStrings.cs
- SQLBytes.cs
- GroupQuery.cs
- TemplateBindingExpression.cs
- Context.cs
- SerialPort.cs
- VirtualDirectoryMapping.cs
- ThemeDictionaryExtension.cs
- ImageClickEventArgs.cs
- TraceHelpers.cs
- PaperSize.cs
- ProjectionPath.cs
- BigInt.cs
- JsonCollectionDataContract.cs
- UnsettableComboBox.cs
- RemotingAttributes.cs
- SmtpNegotiateAuthenticationModule.cs
- XmlChildEnumerator.cs
- ResXFileRef.cs
- XmlIlGenerator.cs
- CategoryState.cs
- StringReader.cs
- Pointer.cs
- Bold.cs
- ProgressBar.cs
- StylusDevice.cs
- DataGridViewCheckBoxCell.cs
- RemoteWebConfigurationHost.cs
- HighlightVisual.cs
- CellConstantDomain.cs
- DetailsView.cs
- OleDbEnumerator.cs
- SemanticAnalyzer.cs
- OleDbRowUpdatingEvent.cs
- Size3DConverter.cs
- KnownTypesProvider.cs
- BuildProvider.cs
- DispatchChannelSink.cs
- MissingSatelliteAssemblyException.cs
- Crc32.cs
- OdbcConnectionHandle.cs
- PeerTransportListenAddressValidatorAttribute.cs
- SafeBitVector32.cs
- WebPartConnectionCollection.cs
- DataGrid.cs
- XmlCDATASection.cs
- ISAPIRuntime.cs
- WmlLabelAdapter.cs
- FrameDimension.cs
- HttpUnhandledOperationInvoker.cs
- ListViewGroup.cs
- CmsInterop.cs
- DrawingImage.cs
- ApplicationDirectoryMembershipCondition.cs
- XmlTextEncoder.cs
- ReadonlyMessageFilter.cs
- PolicyImporterElementCollection.cs
- ImageFormatConverter.cs
- AsyncCompletedEventArgs.cs
- PageParserFilter.cs
- shaper.cs
- JoinTreeSlot.cs
- SqlCacheDependencyDatabase.cs
- ReferenceEqualityComparer.cs
- PageThemeBuildProvider.cs
- FieldToken.cs
- XmlBaseWriter.cs
- UnsafeNativeMethodsTablet.cs
- XmlBoundElement.cs
- JavaScriptObjectDeserializer.cs
- FormsAuthenticationModule.cs
- ProcessHostConfigUtils.cs
- ImageMapEventArgs.cs
- CellNormalizer.cs
- HtmlInputImage.cs
- StreamSecurityUpgradeAcceptorBase.cs
- TypeBuilder.cs
- NumberFormatInfo.cs
- CustomGrammar.cs
- SendMailErrorEventArgs.cs
- RTLAwareMessageBox.cs
- TopClause.cs
- SimpleLine.cs
- AdornerLayer.cs
- GradientStop.cs
- EntityDataSourceViewSchema.cs
- TableLayoutStyleCollection.cs
- FormsAuthenticationCredentials.cs
- FileDialogCustomPlacesCollection.cs
- PagesSection.cs
- OletxCommittableTransaction.cs
- RegexStringValidatorAttribute.cs