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
- WebMessageEncodingElement.cs
- ChangePassword.cs
- Bitmap.cs
- PropertyMetadata.cs
- DesignOnlyAttribute.cs
- DigestComparer.cs
- SizeFConverter.cs
- RolePrincipal.cs
- InternalRelationshipCollection.cs
- TypedElement.cs
- JpegBitmapEncoder.cs
- ExtendedTransformFactory.cs
- BaseParagraph.cs
- HttpProcessUtility.cs
- VariableQuery.cs
- LayoutTable.cs
- Listbox.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ChannelServices.cs
- QuaternionValueSerializer.cs
- SystemDiagnosticsSection.cs
- BadImageFormatException.cs
- OpCodes.cs
- QualificationDataAttribute.cs
- TemplateAction.cs
- recordstatescratchpad.cs
- DesignerMetadata.cs
- MessageQueuePermissionAttribute.cs
- ArgumentException.cs
- Encoder.cs
- RoleManagerEventArgs.cs
- IconConverter.cs
- DispatchOperationRuntime.cs
- Binding.cs
- PageBorderless.cs
- UnsafeNativeMethods.cs
- RootProfilePropertySettingsCollection.cs
- ConstructorBuilder.cs
- AVElementHelper.cs
- FlowNode.cs
- RemoteWebConfigurationHostStream.cs
- XsltQilFactory.cs
- RegexWorker.cs
- SoapCodeExporter.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- ObjectSpanRewriter.cs
- ObjectViewQueryResultData.cs
- RadioButtonFlatAdapter.cs
- SqlDelegatedTransaction.cs
- UserPreference.cs
- _CookieModule.cs
- FullTextLine.cs
- PlanCompilerUtil.cs
- IndexedString.cs
- ExtenderProvidedPropertyAttribute.cs
- CodeLabeledStatement.cs
- VariableQuery.cs
- DesignTimeTemplateParser.cs
- CompilerTypeWithParams.cs
- WebControlsSection.cs
- ComPlusContractBehavior.cs
- NameValueConfigurationElement.cs
- PerformanceCounterScope.cs
- SystemDiagnosticsSection.cs
- EmptyControlCollection.cs
- DetailsViewRow.cs
- XmlSchemas.cs
- SystemIPv4InterfaceProperties.cs
- ProxyManager.cs
- LoopExpression.cs
- X509Logo.cs
- HtmlInputControl.cs
- NullableConverter.cs
- CaretElement.cs
- SupportingTokenListenerFactory.cs
- ContainerParaClient.cs
- XmlSchemaComplexType.cs
- TextTreeDeleteContentUndoUnit.cs
- EventMappingSettingsCollection.cs
- CustomError.cs
- DataControlImageButton.cs
- XmlSchemaParticle.cs
- Debug.cs
- SimpleWebHandlerParser.cs
- ReaderWriterLock.cs
- AnimatedTypeHelpers.cs
- TargetParameterCountException.cs
- EventBuilder.cs
- LinqDataSourceValidationException.cs
- FixedSOMElement.cs
- DataGridViewMethods.cs
- SynchronizingStream.cs
- FreezableDefaultValueFactory.cs
- RepeatBehaviorConverter.cs
- GeometryHitTestResult.cs
- TextServicesHost.cs
- SafeNativeMethods.cs
- ConfigurationManagerHelper.cs
- RankException.cs
- PrintController.cs