Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataObjectFieldAttribute.cs
- TemplateControlCodeDomTreeGenerator.cs
- Literal.cs
- MediaElementAutomationPeer.cs
- HTMLTagNameToTypeMapper.cs
- PermissionSet.cs
- PartitionedStreamMerger.cs
- PassportAuthenticationModule.cs
- ResourcePool.cs
- Pkcs7Recipient.cs
- EnumBuilder.cs
- ServiceErrorHandler.cs
- PropertyMappingExceptionEventArgs.cs
- Classification.cs
- DbConnectionHelper.cs
- FtpRequestCacheValidator.cs
- DataException.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- HwndTarget.cs
- BaseCodeDomTreeGenerator.cs
- EntityContainerRelationshipSet.cs
- EventLogPropertySelector.cs
- PackagePartCollection.cs
- ProgressBar.cs
- WeakHashtable.cs
- CodeDirectoryCompiler.cs
- Logging.cs
- SpeechSynthesizer.cs
- TextRangeEditLists.cs
- DocumentApplicationDocumentViewer.cs
- WsdlImporter.cs
- StrokeCollectionDefaultValueFactory.cs
- clipboard.cs
- PeerTransportListenAddressConverter.cs
- ImageInfo.cs
- TextSimpleMarkerProperties.cs
- XmlNode.cs
- AuthorizationRule.cs
- MsmqQueue.cs
- UpDownBaseDesigner.cs
- ApplicationSecurityInfo.cs
- ToolStripManager.cs
- ConfigurationValues.cs
- SparseMemoryStream.cs
- RegexWorker.cs
- CommonRemoteMemoryBlock.cs
- BuilderElements.cs
- SqlDataSource.cs
- ServiceThrottle.cs
- ContentTextAutomationPeer.cs
- StandardCommandToolStripMenuItem.cs
- InvalidDocumentContentsException.cs
- FocusManager.cs
- MessageBox.cs
- TypefaceMap.cs
- DirectoryNotFoundException.cs
- OperatorExpressions.cs
- MembershipUser.cs
- CompositeKey.cs
- RpcResponse.cs
- XmlProcessingInstruction.cs
- documentation.cs
- WebPartPersonalization.cs
- PTProvider.cs
- HttpModule.cs
- CompiledQueryCacheKey.cs
- ExpressionValueEditor.cs
- TextAnchor.cs
- EdmScalarPropertyAttribute.cs
- CorrelationService.cs
- FileAuthorizationModule.cs
- StaticContext.cs
- Primitive.cs
- View.cs
- VisualStateGroup.cs
- CheckoutException.cs
- RetrieveVirtualItemEventArgs.cs
- BinaryObjectWriter.cs
- CompareInfo.cs
- XmlChildEnumerator.cs
- SatelliteContractVersionAttribute.cs
- HtmlElement.cs
- XmlSchemaDatatype.cs
- Label.cs
- NativeMethods.cs
- DataGridViewRowPostPaintEventArgs.cs
- PreviewPrintController.cs
- UserControlBuildProvider.cs
- TraceLog.cs
- ProgressBarHighlightConverter.cs
- ISessionStateStore.cs
- UnknownBitmapDecoder.cs
- SerializableAttribute.cs
- QueryParameter.cs
- SimpleMailWebEventProvider.cs
- RootAction.cs
- MultiByteCodec.cs
- WizardStepBase.cs
- Partitioner.cs
- LocalValueEnumerator.cs