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
- OleDbInfoMessageEvent.cs
- TextTreeText.cs
- TracingConnectionListener.cs
- TextCollapsingProperties.cs
- PageVisual.cs
- AnnotationHighlightLayer.cs
- DrawingImage.cs
- XmlEncoding.cs
- BamlRecordHelper.cs
- RoleServiceManager.cs
- SmtpException.cs
- ValidatedControlConverter.cs
- RuntimeEnvironment.cs
- LineInfo.cs
- Cursor.cs
- CellParagraph.cs
- SchemaObjectWriter.cs
- Propagator.Evaluator.cs
- XmlDocumentFragment.cs
- NameValuePair.cs
- IisTraceListener.cs
- IntSumAggregationOperator.cs
- EntityExpressionVisitor.cs
- XmlSchemaDatatype.cs
- SamlAttributeStatement.cs
- DynamicControl.cs
- ScriptHandlerFactory.cs
- CompoundFileIOPermission.cs
- DetailsViewModeEventArgs.cs
- WindowsProgressbar.cs
- NameValueCollection.cs
- InkCanvasInnerCanvas.cs
- StateMachine.cs
- WindowsStatic.cs
- PolygonHotSpot.cs
- DateTimeParse.cs
- Int32CAMarshaler.cs
- SchemaNotation.cs
- COM2Properties.cs
- TreeViewEvent.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- XsltLibrary.cs
- BindingExpressionUncommonField.cs
- ConstrainedDataObject.cs
- ExecutionEngineException.cs
- AdornerDecorator.cs
- TextProviderWrapper.cs
- DataGridParentRows.cs
- GroupItemAutomationPeer.cs
- TextSpan.cs
- ValidationResult.cs
- WindowsIPAddress.cs
- XmlSchemaType.cs
- SafePointer.cs
- TrackingServices.cs
- Literal.cs
- PlanCompilerUtil.cs
- UrlPath.cs
- ContainerAction.cs
- FreezableCollection.cs
- ConnectionManagementElementCollection.cs
- RequestQueryParser.cs
- CmsUtils.cs
- CalculatedColumn.cs
- XamlBrushSerializer.cs
- OpenFileDialog.cs
- ReadOnlyTernaryTree.cs
- ExtensionSimplifierMarkupObject.cs
- StaticDataManager.cs
- WindowsToolbar.cs
- ListChangedEventArgs.cs
- ZoomPercentageConverter.cs
- DataGridViewColumnHeaderCell.cs
- sqlser.cs
- SatelliteContractVersionAttribute.cs
- Control.cs
- Viewport3DVisual.cs
- FrugalList.cs
- WindowsGraphicsWrapper.cs
- WsatExtendedInformation.cs
- ProcessThreadCollection.cs
- _AutoWebProxyScriptWrapper.cs
- TextStore.cs
- GACIdentityPermission.cs
- PointLightBase.cs
- StringArrayConverter.cs
- Binding.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- CallContext.cs
- TraceHwndHost.cs
- DataControlReference.cs
- TableLayoutPanelCellPosition.cs
- BreakRecordTable.cs
- ChangePassword.cs
- VisualStyleTypesAndProperties.cs
- SafeRsaProviderHandle.cs
- InkSerializer.cs
- WebPartDisplayModeEventArgs.cs
- PresentationTraceSources.cs
- CodeMethodInvokeExpression.cs