Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _SSPISessionCache.cs / 1305376 / _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()); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- KeyValueConfigurationCollection.cs
- InputLangChangeEvent.cs
- SmiSettersStream.cs
- HttpModuleActionCollection.cs
- DataSpaceManager.cs
- HtmlInputReset.cs
- TaiwanLunisolarCalendar.cs
- SystemResourceKey.cs
- CrossContextChannel.cs
- XPathNavigator.cs
- SymmetricSecurityProtocolFactory.cs
- CustomExpression.cs
- JsonObjectDataContract.cs
- HttpCookiesSection.cs
- StringInfo.cs
- SystemSounds.cs
- ResolvedKeyFrameEntry.cs
- MultiBindingExpression.cs
- ValueProviderWrapper.cs
- BufferModeSettings.cs
- LeaseManager.cs
- CodeDOMProvider.cs
- SimpleType.cs
- XmlSchemaSimpleContent.cs
- MonitorWrapper.cs
- UnauthorizedAccessException.cs
- PropertyChangedEventManager.cs
- DataGridViewCellCancelEventArgs.cs
- ParserContext.cs
- SizeF.cs
- LambdaCompiler.Binary.cs
- ReverseInheritProperty.cs
- EnumerableValidator.cs
- GroupLabel.cs
- DataGridCellInfo.cs
- RuleElement.cs
- GroupLabel.cs
- BrowserCapabilitiesFactoryBase.cs
- BasicViewGenerator.cs
- precedingquery.cs
- MetadataCollection.cs
- Italic.cs
- AlphabeticalEnumConverter.cs
- DocumentPageView.cs
- CookieParameter.cs
- SystemWebSectionGroup.cs
- CompilationRelaxations.cs
- WindowsToolbarAsMenu.cs
- ReadOnlyCollectionBase.cs
- TraceHwndHost.cs
- WinEventWrap.cs
- EdmPropertyAttribute.cs
- SecurityPermission.cs
- RedistVersionInfo.cs
- IPCCacheManager.cs
- Label.cs
- MsmqReceiveHelper.cs
- FocusManager.cs
- Single.cs
- UpdatePanelControlTrigger.cs
- RegexWorker.cs
- DbCommandDefinition.cs
- RowVisual.cs
- RegexTree.cs
- CommandHelpers.cs
- MessagingDescriptionAttribute.cs
- AppDomain.cs
- followingquery.cs
- DataGridLength.cs
- RTLAwareMessageBox.cs
- ListViewUpdatedEventArgs.cs
- NameTable.cs
- CheckBoxDesigner.cs
- HttpInputStream.cs
- CodeMethodReturnStatement.cs
- ClientSponsor.cs
- CodeTypeReferenceSerializer.cs
- DesignerDataConnection.cs
- ForceCopyBuildProvider.cs
- SchemaObjectWriter.cs
- IntermediatePolicyValidator.cs
- DesigntimeLicenseContext.cs
- EpmCustomContentSerializer.cs
- PseudoWebRequest.cs
- StreamSecurityUpgradeAcceptor.cs
- XsltLibrary.cs
- Grant.cs
- ChannelPoolSettingsElement.cs
- SecurityDocument.cs
- safex509handles.cs
- HttpCapabilitiesBase.cs
- ISAPIApplicationHost.cs
- FlowDocumentPageViewerAutomationPeer.cs
- CLRBindingWorker.cs
- GridViewHeaderRowPresenter.cs
- EncryptedData.cs
- ThreadLocal.cs
- cookiecollection.cs
- HighContrastHelper.cs
- EntityUtil.cs