Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ImpersonateTokenRef.cs / 1305376 / 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
- OutputCacheSettingsSection.cs
- LocalServiceSecuritySettingsElement.cs
- CounterSampleCalculator.cs
- ConstructorExpr.cs
- DataRowView.cs
- DataBindEngine.cs
- WinEventQueueItem.cs
- StylusCaptureWithinProperty.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- ReferenceEqualityComparer.cs
- DataViewSetting.cs
- FixedTextPointer.cs
- HierarchicalDataBoundControlAdapter.cs
- XPathPatternParser.cs
- BaseComponentEditor.cs
- BitmapEncoder.cs
- handlecollector.cs
- DataGridHeaderBorder.cs
- EUCJPEncoding.cs
- PassportAuthenticationEventArgs.cs
- XPathSingletonIterator.cs
- TraceSection.cs
- XamlSerializer.cs
- ConversionHelper.cs
- WorkflowServiceHostFactory.cs
- ReplacementText.cs
- SqlDelegatedTransaction.cs
- SchemaTypeEmitter.cs
- Animatable.cs
- InvalidProgramException.cs
- ValueHandle.cs
- ToolStripContainerActionList.cs
- ToggleProviderWrapper.cs
- SplayTreeNode.cs
- ColorKeyFrameCollection.cs
- MembershipValidatePasswordEventArgs.cs
- DbReferenceCollection.cs
- ContainerSelectorGlyph.cs
- Ref.cs
- SinglePhaseEnlistment.cs
- HtmlTextViewAdapter.cs
- TraceUtility.cs
- ValidatorUtils.cs
- XmlIgnoreAttribute.cs
- WmlCommandAdapter.cs
- Accessors.cs
- TraceInternal.cs
- WebPartManager.cs
- StringDictionaryCodeDomSerializer.cs
- SynchronizationValidator.cs
- TreeNodeBindingCollection.cs
- TextRangeEdit.cs
- NativeMethods.cs
- DataListItemEventArgs.cs
- controlskin.cs
- WebPartMenu.cs
- CompilerState.cs
- RunWorkerCompletedEventArgs.cs
- MachineSettingsSection.cs
- DrawingServices.cs
- TextPenaltyModule.cs
- PrintDialogException.cs
- ListSortDescriptionCollection.cs
- HttpWrapper.cs
- Math.cs
- ObsoleteAttribute.cs
- EventSourceCreationData.cs
- DocumentSchemaValidator.cs
- SafePointer.cs
- SqlParameterCollection.cs
- LinqToSqlWrapper.cs
- LongMinMaxAggregationOperator.cs
- RawStylusInputCustomDataList.cs
- RegisteredHiddenField.cs
- NotImplementedException.cs
- WebResponse.cs
- HandlerFactoryCache.cs
- PeerNameRecord.cs
- FileDialogCustomPlace.cs
- HasCopySemanticsAttribute.cs
- PocoEntityKeyStrategy.cs
- EntityDataSourceSelectingEventArgs.cs
- XmlToDatasetMap.cs
- Serializer.cs
- DataGridViewTextBoxEditingControl.cs
- SHA512.cs
- versioninfo.cs
- GridViewColumnCollectionChangedEventArgs.cs
- Size.cs
- RemoteEndpointMessageProperty.cs
- NativeRecognizer.cs
- EdmSchemaAttribute.cs
- Highlights.cs
- WebPartAuthorizationEventArgs.cs
- FreezableCollection.cs
- LinkArea.cs
- AsyncOperationManager.cs
- PrincipalPermission.cs
- XmlDataProvider.cs
- CacheEntry.cs