Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ImpersonateTokenRef.cs / 1305376 / 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
- BufferedReadStream.cs
- PtsHost.cs
- ValueUnavailableException.cs
- ChannelCacheDefaults.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- DataPointer.cs
- HttpDictionary.cs
- UnaryNode.cs
- InstanceNotReadyException.cs
- PanelStyle.cs
- webeventbuffer.cs
- DesignerTransactionCloseEvent.cs
- dbdatarecord.cs
- SHA256.cs
- ServiceInfo.cs
- TypeSemantics.cs
- HttpCacheVaryByContentEncodings.cs
- AsymmetricKeyExchangeDeformatter.cs
- ScaleTransform3D.cs
- WorkflowMessageEventArgs.cs
- GestureRecognizer.cs
- TextPointer.cs
- UrlPropertyAttribute.cs
- SerializableAttribute.cs
- StylusPointPropertyInfoDefaults.cs
- CryptographicAttribute.cs
- EventLogRecord.cs
- Validator.cs
- DecoderExceptionFallback.cs
- ValidationResults.cs
- Baml2006KeyRecord.cs
- SHA256.cs
- EventHandlingScope.cs
- ForceCopyBuildProvider.cs
- FormView.cs
- ExtensionQuery.cs
- RemotingSurrogateSelector.cs
- CalendarData.cs
- SimpleApplicationHost.cs
- SqlConnectionStringBuilder.cs
- XamlTreeBuilderBamlRecordWriter.cs
- SettingsBindableAttribute.cs
- DynamicObject.cs
- WebDisplayNameAttribute.cs
- PrivilegedConfigurationManager.cs
- IgnorePropertiesAttribute.cs
- SQLSingleStorage.cs
- WindowHideOrCloseTracker.cs
- TemplateBindingExpression.cs
- TextElementEditingBehaviorAttribute.cs
- EncodingTable.cs
- EastAsianLunisolarCalendar.cs
- CloseSequenceResponse.cs
- PageRouteHandler.cs
- SHA256.cs
- InstanceKeyCompleteException.cs
- ProcessStartInfo.cs
- RelatedCurrencyManager.cs
- FloatUtil.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- OneOfTypeConst.cs
- ButtonBaseAutomationPeer.cs
- TdsParserHelperClasses.cs
- XmlBinaryWriterSession.cs
- RequestCacheManager.cs
- Button.cs
- IOException.cs
- StreamWriter.cs
- __FastResourceComparer.cs
- StringBuilder.cs
- LockCookie.cs
- QuaternionRotation3D.cs
- BuildProviderAppliesToAttribute.cs
- ObjRef.cs
- documentsequencetextcontainer.cs
- TimeZone.cs
- AdvancedBindingPropertyDescriptor.cs
- SqlXml.cs
- SqlCommandBuilder.cs
- ClientScriptManagerWrapper.cs
- InputReport.cs
- EncoderFallback.cs
- SiteMapPath.cs
- DurableServiceAttribute.cs
- ColumnPropertiesGroup.cs
- BitHelper.cs
- WindowsAltTab.cs
- FontCacheLogic.cs
- MulticastNotSupportedException.cs
- SoapEnvelopeProcessingElement.cs
- HttpContextBase.cs
- SchemaDeclBase.cs
- HashHelper.cs
- PageWrapper.cs
- MetadataUtilsSmi.cs
- ContractBase.cs
- BinaryConverter.cs
- Utils.cs
- ViewCellRelation.cs
- SqlWriter.cs