Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ServiceMemoryGates.cs
- SqlDuplicator.cs
- HandlerMappingMemo.cs
- KeyInterop.cs
- XamlPointCollectionSerializer.cs
- NodeFunctions.cs
- TypePresenter.xaml.cs
- FixedSchema.cs
- DataShape.cs
- AuthenticatedStream.cs
- BuildProvider.cs
- ControlDesignerState.cs
- WebPartConnectionsConnectVerb.cs
- DesignSurfaceManager.cs
- PerfCounters.cs
- DbTypeMap.cs
- TypeInitializationException.cs
- ConfigurationSectionCollection.cs
- TextBoxRenderer.cs
- ImportCatalogPart.cs
- ElementProxy.cs
- ToolboxItemAttribute.cs
- PersonalizationAdministration.cs
- ObjectStateManagerMetadata.cs
- QueryCacheEntry.cs
- ProvidePropertyAttribute.cs
- PropertyValueUIItem.cs
- MLangCodePageEncoding.cs
- AvTrace.cs
- XmlEnumAttribute.cs
- BufferAllocator.cs
- Sql8ExpressionRewriter.cs
- PenContexts.cs
- TypeConverterHelper.cs
- XmlDataSourceView.cs
- FrameworkObject.cs
- UnsafeNativeMethodsCLR.cs
- EventSetterHandlerConverter.cs
- NamespaceMapping.cs
- BitmapData.cs
- TagPrefixCollection.cs
- ConsoleCancelEventArgs.cs
- BinaryParser.cs
- DateTimeFormat.cs
- DataListAutoFormat.cs
- SamlSerializer.cs
- KeyConstraint.cs
- Message.cs
- GroupItem.cs
- MULTI_QI.cs
- SignatureHelper.cs
- OwnerDrawPropertyBag.cs
- OperationFormatStyle.cs
- MemberExpression.cs
- ProcessRequestArgs.cs
- LogSwitch.cs
- UTF7Encoding.cs
- BmpBitmapDecoder.cs
- ServiceDebugElement.cs
- QueryOutputWriter.cs
- IpcChannel.cs
- cookiecollection.cs
- Label.cs
- HiddenField.cs
- EtwTrace.cs
- WindowsFormsSynchronizationContext.cs
- _LocalDataStoreMgr.cs
- ConditionalDesigner.cs
- RealizationDrawingContextWalker.cs
- WebPartMovingEventArgs.cs
- SortedSet.cs
- Number.cs
- WindowsSlider.cs
- EditorAttributeInfo.cs
- SvcMapFile.cs
- Perspective.cs
- Int32Storage.cs
- SqlDependency.cs
- RichTextBoxConstants.cs
- Calendar.cs
- BrowserCapabilitiesFactoryBase.cs
- SafeCryptHandles.cs
- BrowserCapabilitiesCodeGenerator.cs
- GridPattern.cs
- ServiceOperation.cs
- XmlSerializationWriter.cs
- DecimalConverter.cs
- PersistenceTask.cs
- ToolStripDesigner.cs
- BulletedList.cs
- QueryAccessibilityHelpEvent.cs
- DrawItemEvent.cs
- GeometryGroup.cs
- Stopwatch.cs
- SQLRoleProvider.cs
- SiteMapNodeItemEventArgs.cs
- WebZone.cs
- PKCS1MaskGenerationMethod.cs
- UpdateCommandGenerator.cs
- NumberFormatInfo.cs