Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SynchronizedInputHelper.cs
- TextTreeFixupNode.cs
- UriTemplateTable.cs
- dataobject.cs
- CellTreeNodeVisitors.cs
- LinqDataSourceValidationException.cs
- cache.cs
- ReachPageContentSerializerAsync.cs
- ScrollChrome.cs
- DataListItemEventArgs.cs
- DayRenderEvent.cs
- Directory.cs
- OptimalTextSource.cs
- ControlIdConverter.cs
- BindingOperations.cs
- ICollection.cs
- FunctionQuery.cs
- ProgressBarAutomationPeer.cs
- BamlRecordWriter.cs
- SQLInt32Storage.cs
- CreateUserWizardAutoFormat.cs
- Point3DCollection.cs
- OperationParameterInfoCollection.cs
- ContentElementCollection.cs
- DotExpr.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Grant.cs
- TaiwanCalendar.cs
- SafeBuffer.cs
- GACIdentityPermission.cs
- HtmlAnchor.cs
- AllMembershipCondition.cs
- DataSourceXmlTextReader.cs
- AsymmetricAlgorithm.cs
- ContextToken.cs
- AssemblyBuilderData.cs
- TripleDES.cs
- HeaderCollection.cs
- HMACMD5.cs
- FixedSOMTable.cs
- RegistrySecurity.cs
- ScriptManager.cs
- SystemTcpStatistics.cs
- RsaSecurityToken.cs
- SoapCommonClasses.cs
- JoinSymbol.cs
- ShaperBuffers.cs
- MonthChangedEventArgs.cs
- QuaternionRotation3D.cs
- PatternMatcher.cs
- InvalidOleVariantTypeException.cs
- BooleanExpr.cs
- ObjectQuery_EntitySqlExtensions.cs
- SimpleApplicationHost.cs
- DataRowView.cs
- ProtocolsConfiguration.cs
- TouchPoint.cs
- ResourceBinder.cs
- ConstructorBuilder.cs
- AssociationEndMember.cs
- NavigationWindow.cs
- FixedSOMPage.cs
- ConfigurationSectionGroup.cs
- ConfigUtil.cs
- UriTemplateDispatchFormatter.cs
- DiscoveryEndpointValidator.cs
- XmlReaderSettings.cs
- DataGridViewCellValueEventArgs.cs
- TableLayoutPanelCellPosition.cs
- RelationshipDetailsRow.cs
- WebRequest.cs
- XmlCustomFormatter.cs
- QueryCursorEventArgs.cs
- ImageFormat.cs
- LogicalExpr.cs
- METAHEADER.cs
- PropertyValue.cs
- CompilerWrapper.cs
- ImageCollectionCodeDomSerializer.cs
- HotSpotCollection.cs
- InsufficientMemoryException.cs
- ObjectSet.cs
- BookmarkEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- TraceHandlerErrorFormatter.cs
- CompilerGlobalScopeAttribute.cs
- PropertyTab.cs
- LayoutEngine.cs
- ColorIndependentAnimationStorage.cs
- ModelPropertyDescriptor.cs
- InstancePersistenceContext.cs
- ButtonFlatAdapter.cs
- XmlChildNodes.cs
- Marshal.cs
- MenuItemBindingCollection.cs
- Int32CollectionValueSerializer.cs
- ToolStripDropDownClosingEventArgs.cs
- HWStack.cs
- LayoutTable.cs
- SchemaImporterExtensionsSection.cs