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
- RuntimeConfigurationRecord.cs
- TemplateLookupAction.cs
- FixedSOMTextRun.cs
- CheckBoxList.cs
- TextWriterEngine.cs
- MachineKeySection.cs
- XhtmlBasicValidationSummaryAdapter.cs
- LoggedException.cs
- SchemaNotation.cs
- ErrorFormatterPage.cs
- CaseExpr.cs
- PackageProperties.cs
- Object.cs
- DataGridViewLayoutData.cs
- ItemsPresenter.cs
- LineServices.cs
- WebPartsPersonalization.cs
- AsyncPostBackTrigger.cs
- HtmlHead.cs
- SqlTriggerContext.cs
- BoundingRectTracker.cs
- WebServiceMethodData.cs
- RelatedView.cs
- FirstMatchCodeGroup.cs
- CodeTypeMember.cs
- ColorTransform.cs
- BoolLiteral.cs
- XDRSchema.cs
- TransformerTypeCollection.cs
- IncrementalReadDecoders.cs
- X509CertificateCollection.cs
- PageParserFilter.cs
- DispatchChannelSink.cs
- WebPartMinimizeVerb.cs
- InOutArgument.cs
- GeneralTransformGroup.cs
- Exceptions.cs
- CodeDomLoader.cs
- BinaryCommonClasses.cs
- FileSystemInfo.cs
- HierarchicalDataSourceControl.cs
- InternalCache.cs
- DataMemberAttribute.cs
- InternalBufferManager.cs
- PerformanceCounterPermissionEntry.cs
- x509utils.cs
- ReflectTypeDescriptionProvider.cs
- ModifiableIteratorCollection.cs
- RepeaterItem.cs
- ACL.cs
- StreamSecurityUpgradeAcceptor.cs
- DesignerDataStoredProcedure.cs
- MSHTMLHost.cs
- EndEvent.cs
- EdmTypeAttribute.cs
- WpfXamlType.cs
- PrintPageEvent.cs
- XPathSingletonIterator.cs
- LifetimeServices.cs
- DataGridViewBand.cs
- GB18030Encoding.cs
- ContainerFilterService.cs
- FontWeights.cs
- SqlUserDefinedTypeAttribute.cs
- StreamFormatter.cs
- ListParaClient.cs
- FontDialog.cs
- __Filters.cs
- RowParagraph.cs
- PropertyEntry.cs
- SoapIgnoreAttribute.cs
- OleDbException.cs
- DateTimeParse.cs
- DynamicQueryableWrapper.cs
- PasswordDeriveBytes.cs
- CodeMemberMethod.cs
- DependencyPropertyAttribute.cs
- BamlResourceContent.cs
- DotExpr.cs
- sqlpipe.cs
- HttpResponseHeader.cs
- Transform.cs
- util.cs
- LassoSelectionBehavior.cs
- TracedNativeMethods.cs
- OutputChannel.cs
- CodeTypeReferenceSerializer.cs
- TrustLevel.cs
- ComNativeDescriptor.cs
- ChannelPoolSettings.cs
- DBConcurrencyException.cs
- WorkflowTimerService.cs
- Size3DConverter.cs
- TypefaceCollection.cs
- SqlDataSourceCache.cs
- Debug.cs
- HttpListenerResponse.cs
- DataServiceHostFactory.cs
- MarkupWriter.cs
- BidOverLoads.cs