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
- ActivationServices.cs
- sapiproxy.cs
- QuaternionIndependentAnimationStorage.cs
- MDIControlStrip.cs
- WebConvert.cs
- ScriptModule.cs
- HttpCookieCollection.cs
- ArglessEventHandlerProxy.cs
- InstanceHandleConflictException.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- UnsafeNativeMethods.cs
- ConsoleTraceListener.cs
- GeneratedCodeAttribute.cs
- BreadCrumbTextConverter.cs
- InProcStateClientManager.cs
- HelpExampleGenerator.cs
- TrackPointCollection.cs
- BackgroundFormatInfo.cs
- DynamicMethod.cs
- WebRequestModuleElement.cs
- DataDocumentXPathNavigator.cs
- XmlMapping.cs
- EntityStoreSchemaGenerator.cs
- WorkItem.cs
- HebrewNumber.cs
- RolePrincipal.cs
- ExpressionLink.cs
- validationstate.cs
- DesignerRegionMouseEventArgs.cs
- Preprocessor.cs
- CodeCatchClause.cs
- DataSourceCache.cs
- TcpPortSharing.cs
- XslTransformFileEditor.cs
- Automation.cs
- MetadataReference.cs
- SerializationEventsCache.cs
- HtmlToClrEventProxy.cs
- InputLanguageEventArgs.cs
- TcpPortSharing.cs
- TextBoxAutomationPeer.cs
- ResourceSet.cs
- QueryableDataSource.cs
- BitmapMetadataBlob.cs
- SubstitutionResponseElement.cs
- IImplicitResourceProvider.cs
- Switch.cs
- TimeoutException.cs
- ItemCheckedEvent.cs
- _ListenerAsyncResult.cs
- UshortList2.cs
- DataGridTextColumn.cs
- XmlnsCompatibleWithAttribute.cs
- ClientBuildManagerCallback.cs
- EntityDataSourceDesigner.cs
- StreamUpdate.cs
- ComplexPropertyEntry.cs
- EntityContainer.cs
- ButtonColumn.cs
- TreeView.cs
- DataSet.cs
- ClientBase.cs
- DataTemplate.cs
- BinaryFormatterWriter.cs
- Point3D.cs
- ArraySet.cs
- ItemsControl.cs
- AdPostCacheSubstitution.cs
- TypeDelegator.cs
- COM2PictureConverter.cs
- ScriptResourceDefinition.cs
- PartitionedStreamMerger.cs
- LocalizationParserHooks.cs
- SplineQuaternionKeyFrame.cs
- JsonEncodingStreamWrapper.cs
- MessageLogTraceRecord.cs
- PointKeyFrameCollection.cs
- X509IssuerSerialKeyIdentifierClause.cs
- PeerNearMe.cs
- Ray3DHitTestResult.cs
- NetworkInformationPermission.cs
- DataGridTable.cs
- CodeCatchClause.cs
- ListSourceHelper.cs
- ScalarOps.cs
- PersistenceException.cs
- Trace.cs
- QuaternionAnimation.cs
- XmlValueConverter.cs
- AutomationPatternInfo.cs
- TraceSection.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ApplyHostConfigurationBehavior.cs
- DefaultExpression.cs
- UTF32Encoding.cs
- StylusDownEventArgs.cs
- ScriptingAuthenticationServiceSection.cs
- MouseEventArgs.cs
- ColumnWidthChangingEvent.cs
- XmlBinaryReaderSession.cs