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
- BufferBuilder.cs
- PrintPreviewDialog.cs
- WebEventCodes.cs
- MultiSelector.cs
- XmlTextAttribute.cs
- CodeExpressionStatement.cs
- IPGlobalProperties.cs
- PropertyBuilder.cs
- Overlapped.cs
- InstanceDataCollection.cs
- CheckBoxAutomationPeer.cs
- QilScopedVisitor.cs
- HostingEnvironment.cs
- FullTrustAssemblyCollection.cs
- AlphabeticalEnumConverter.cs
- TraceRecord.cs
- KeyGestureConverter.cs
- LocalFileSettingsProvider.cs
- TreeChangeInfo.cs
- VirtualDirectoryMapping.cs
- MultipartContentParser.cs
- TemplateColumn.cs
- PropertyCondition.cs
- RuntimeVariablesExpression.cs
- PagesSection.cs
- ErrorActivity.cs
- RepeaterCommandEventArgs.cs
- VisualBrush.cs
- MemoryMappedFileSecurity.cs
- SerializationSectionGroup.cs
- SQLDecimal.cs
- DynamicFilterExpression.cs
- CharStorage.cs
- IntranetCredentialPolicy.cs
- DataGridColumnHeader.cs
- TypeUsageBuilder.cs
- TextRangeProviderWrapper.cs
- RangeBase.cs
- DateTimeSerializationSection.cs
- ByteStreamMessageEncodingElement.cs
- httpserverutility.cs
- XmlSchemaImporter.cs
- WmlListAdapter.cs
- InputBuffer.cs
- XmlLanguageConverter.cs
- PagerStyle.cs
- ColumnCollectionEditor.cs
- SizeAnimationClockResource.cs
- ButtonRenderer.cs
- OlePropertyStructs.cs
- LoadGrammarCompletedEventArgs.cs
- GuidTagList.cs
- CompilerCollection.cs
- ParamArrayAttribute.cs
- ConfigurationPropertyCollection.cs
- ProcessModelSection.cs
- FileLogRecordHeader.cs
- VSWCFServiceContractGenerator.cs
- AuthorizationSection.cs
- EntityTypeEmitter.cs
- SafeEventHandle.cs
- EntitySetBase.cs
- WebPartRestoreVerb.cs
- GC.cs
- EntitySetDataBindingList.cs
- SingleAnimationBase.cs
- GestureRecognitionResult.cs
- PerformanceCounterManager.cs
- OdbcDataAdapter.cs
- xmlsaver.cs
- DefaultPrintController.cs
- GenericXmlSecurityToken.cs
- DeploymentExceptionMapper.cs
- FontStyles.cs
- FunctionImportElement.cs
- RecipientIdentity.cs
- ActivityCodeDomReferenceService.cs
- LoginUtil.cs
- XmlDataImplementation.cs
- UnhandledExceptionEventArgs.cs
- CodeArgumentReferenceExpression.cs
- AnimatedTypeHelpers.cs
- Int32Collection.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- EventListenerClientSide.cs
- GAC.cs
- CheckBox.cs
- MissingSatelliteAssemblyException.cs
- WebPartEventArgs.cs
- TreeBuilder.cs
- ControlParameter.cs
- BooleanConverter.cs
- TableColumn.cs
- BaseProcessProtocolHandler.cs
- ConstraintConverter.cs
- AttachedAnnotationChangedEventArgs.cs
- ImageCodecInfo.cs
- ItemAutomationPeer.cs
- DataBindingHandlerAttribute.cs
- ResourceContainer.cs