Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / _SSPISessionCache.cs / 1 / _SSPISessionCache.cs
/*++ Copyright (c) Microsoft Corporation Module Name: _SspiSessionCache.cs Abstract: The file implements trivial SSPI credential caching mechanism based on lru list Author: Alexei Vopilov 20-Oct-2004 Revision History: --*/ namespace System.Net.Security { using System.Net; using System.Threading; using System.Collections; // // Implements delayed SSPI handle release, like a finalizable object though the handles are kept alive until being pushed out // by the newly incoming ones. // internal static class SSPIHandleCache { private const int c_MaxCacheSize = 0x1F; // must a (power of 2) - 1 private static SafeCredentialReference[] _CacheSlots = new SafeCredentialReference[c_MaxCacheSize+1]; private static int _Current = -1; internal static void CacheCredential(SafeFreeCredentials newHandle) { try { SafeCredentialReference newRef = SafeCredentialReference.CreateReference(newHandle); if (newRef == null) return; unchecked { int index = Interlocked.Increment(ref _Current) & c_MaxCacheSize; newRef = Interlocked.Exchange(ref _CacheSlots[index], newRef); } if (newRef != null) newRef.Close(); } catch(Exception e) { if (!NclUtilities.IsFatal(e)){ GlobalLog.Assert("SSPIHandlCache", "Attempted to throw: " + e.ToString()); } } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DocumentNUp.cs
- SkipStoryboardToFill.cs
- ClrProviderManifest.cs
- Int32.cs
- StructuralType.cs
- AlternateViewCollection.cs
- SignatureDescription.cs
- FixedStringLookup.cs
- securitycriticaldataClass.cs
- SqlConnectionStringBuilder.cs
- PagePropertiesChangingEventArgs.cs
- SetterBase.cs
- HtmlInputRadioButton.cs
- PropertyValueChangedEvent.cs
- SslStream.cs
- MultiTrigger.cs
- BamlLocalizableResource.cs
- TableLayout.cs
- userdatakeys.cs
- Dump.cs
- ConfigXmlComment.cs
- KnownTypeHelper.cs
- LinqDataSourceSelectEventArgs.cs
- FileLoadException.cs
- OdbcParameterCollection.cs
- XmlSchemaExternal.cs
- WriterOutput.cs
- ListViewAutomationPeer.cs
- ScrollPattern.cs
- FloaterBaseParagraph.cs
- DecimalAnimationBase.cs
- AuthenticationModulesSection.cs
- CollectionViewGroup.cs
- ZoneMembershipCondition.cs
- ParagraphResult.cs
- SRDisplayNameAttribute.cs
- BitmapEffectInput.cs
- DataGridColumnCollectionEditor.cs
- LocalIdKeyIdentifierClause.cs
- TabControlAutomationPeer.cs
- IndependentAnimationStorage.cs
- XmlDeclaration.cs
- UpdateException.cs
- AccessibleObject.cs
- CodeLinePragma.cs
- TextTreeUndo.cs
- CodeNamespace.cs
- ApplicationTrust.cs
- PeerNameRecord.cs
- MimeFormatExtensions.cs
- SystemIcmpV6Statistics.cs
- ReaderOutput.cs
- _ConnectionGroup.cs
- TimeStampChecker.cs
- ContextActivityUtils.cs
- TimeoutConverter.cs
- ScaleTransform.cs
- PersonalizationProviderCollection.cs
- Point3D.cs
- DesignParameter.cs
- SqlInternalConnection.cs
- ProgressBarHighlightConverter.cs
- ColorIndependentAnimationStorage.cs
- PrtTicket_Public_Simple.cs
- TranslateTransform3D.cs
- XmlAttributeCollection.cs
- SQLCharsStorage.cs
- DomainConstraint.cs
- ListViewSelectEventArgs.cs
- ExpressionHelper.cs
- BrushMappingModeValidation.cs
- SmtpTransport.cs
- Int32CAMarshaler.cs
- SamlAudienceRestrictionCondition.cs
- DataServiceResponse.cs
- ControlPropertyNameConverter.cs
- XPathScanner.cs
- OperationDescription.cs
- webbrowsersite.cs
- JsonStringDataContract.cs
- RandomNumberGenerator.cs
- SafeNativeMethodsOther.cs
- QueryContinueDragEvent.cs
- ProfileSettings.cs
- CheckBoxStandardAdapter.cs
- RegexCode.cs
- fixedPageContentExtractor.cs
- MILUtilities.cs
- RestHandler.cs
- PageHandlerFactory.cs
- CodeFieldReferenceExpression.cs
- InertiaExpansionBehavior.cs
- EntityUtil.cs
- X509WindowsSecurityToken.cs
- PasswordBoxAutomationPeer.cs
- DataKeyArray.cs
- WindowsListViewGroupHelper.cs
- ListViewCommandEventArgs.cs
- SHA256.cs
- MarshalByRefObject.cs