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
- CalendarItem.cs
- DocumentViewerBase.cs
- ClientApiGenerator.cs
- HostingEnvironmentException.cs
- Soap12ServerProtocol.cs
- ImmutableObjectAttribute.cs
- DataObjectEventArgs.cs
- GenericUriParser.cs
- OracleBinary.cs
- MediaEntryAttribute.cs
- WindowsTreeView.cs
- Int32CollectionConverter.cs
- Typography.cs
- StringArrayEditor.cs
- MdiWindowListStrip.cs
- TreeNodeCollectionEditorDialog.cs
- InstanceDescriptor.cs
- LogRecordSequence.cs
- WorkingDirectoryEditor.cs
- DbParameterCollection.cs
- log.cs
- Debug.cs
- RtfToXamlReader.cs
- Tile.cs
- Decimal.cs
- WebPartMovingEventArgs.cs
- ResourcesChangeInfo.cs
- ConnectionStringsSection.cs
- HtmlProps.cs
- FunctionNode.cs
- TcpProcessProtocolHandler.cs
- CodeTypeConstructor.cs
- CodeDelegateInvokeExpression.cs
- BuildProvider.cs
- SqlDataSourceSelectingEventArgs.cs
- AdornerPresentationContext.cs
- SourceItem.cs
- SafeArchiveContext.cs
- CqlParser.cs
- AsyncPostBackTrigger.cs
- DocumentViewerAutomationPeer.cs
- ErrorInfoXmlDocument.cs
- XsdBuildProvider.cs
- HashAlgorithm.cs
- XmlQueryCardinality.cs
- CompositeControl.cs
- IisTraceListener.cs
- EditorZoneBase.cs
- ListViewItemEventArgs.cs
- ExternalCalls.cs
- RtfToXamlLexer.cs
- DPAPIProtectedConfigurationProvider.cs
- Enum.cs
- AutomationElement.cs
- Convert.cs
- SelectedCellsChangedEventArgs.cs
- Utils.cs
- CodeArrayIndexerExpression.cs
- CurrentTimeZone.cs
- CalendarAutomationPeer.cs
- VirtualStackFrame.cs
- FlowSwitchLink.cs
- ListManagerBindingsCollection.cs
- SecurityToken.cs
- CmsInterop.cs
- InputLangChangeRequestEvent.cs
- LogAppendAsyncResult.cs
- MethodBody.cs
- ConstraintCollection.cs
- NavigatorInput.cs
- DataGridViewCheckBoxColumn.cs
- PolyQuadraticBezierSegment.cs
- TriggerActionCollection.cs
- Literal.cs
- Bezier.cs
- BitmapCache.cs
- EFTableProvider.cs
- LoadItemsEventArgs.cs
- Storyboard.cs
- DisplayMemberTemplateSelector.cs
- TextBoxBaseDesigner.cs
- CodeAttributeArgument.cs
- BooleanFunctions.cs
- ScriptServiceAttribute.cs
- StateMachineHistory.cs
- BasicCellRelation.cs
- TransportSecurityHelpers.cs
- XamlInterfaces.cs
- WsiProfilesElement.cs
- GlyphingCache.cs
- ConfigXmlAttribute.cs
- RuleAction.cs
- TagPrefixCollection.cs
- PartitionedDataSource.cs
- IsolatedStorageException.cs
- FlowLayoutPanel.cs
- KeyToListMap.cs
- XsdBuilder.cs
- DataServiceContext.cs
- ConfigurationLockCollection.cs