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
- UrlPropertyAttribute.cs
- TableAdapterManagerHelper.cs
- Vector3DCollectionConverter.cs
- FormsAuthenticationEventArgs.cs
- SqlParameter.cs
- QueryConverter.cs
- GridViewSelectEventArgs.cs
- HwndStylusInputProvider.cs
- WebPartZoneDesigner.cs
- DesignTable.cs
- HttpConfigurationSystem.cs
- XPathDocumentNavigator.cs
- DbParameterCollectionHelper.cs
- Misc.cs
- ManagedWndProcTracker.cs
- ParallelForEach.cs
- SqlHelper.cs
- ObjectDataSourceDisposingEventArgs.cs
- ValueHandle.cs
- WindowVisualStateTracker.cs
- ChtmlTextWriter.cs
- RangeValuePatternIdentifiers.cs
- FixedSOMPage.cs
- CodeVariableDeclarationStatement.cs
- MailAddress.cs
- VScrollProperties.cs
- TextCompositionManager.cs
- CodeValidator.cs
- ThreadStartException.cs
- GridLength.cs
- LicenseException.cs
- TypeBuilder.cs
- ImpersonateTokenRef.cs
- XmlSerializableReader.cs
- ListViewContainer.cs
- TextDecoration.cs
- DesignRelation.cs
- AsyncResult.cs
- ColorAnimation.cs
- FrameworkElement.cs
- DBDataPermission.cs
- MergeEnumerator.cs
- WebPartConnectionsCancelVerb.cs
- DesignerActionVerbList.cs
- SizeAnimationUsingKeyFrames.cs
- XmlNamespaceMappingCollection.cs
- QueryOpcode.cs
- SymbolEqualComparer.cs
- isolationinterop.cs
- SafeLocalMemHandle.cs
- XPathNavigator.cs
- StorageEntityTypeMapping.cs
- Keyboard.cs
- TemplateControlBuildProvider.cs
- HighContrastHelper.cs
- XmlHelper.cs
- RequestCacheValidator.cs
- XsltQilFactory.cs
- ConsoleEntryPoint.cs
- XmlNodeComparer.cs
- MetabaseReader.cs
- UnsafeNativeMethods.cs
- PrimitiveSchema.cs
- PropertyOverridesTypeEditor.cs
- SqlBooleanMismatchVisitor.cs
- WebServiceHandlerFactory.cs
- PartialCachingControl.cs
- Margins.cs
- WorkflowExecutor.cs
- DrawingBrush.cs
- ConfigXmlDocument.cs
- ResourceAssociationType.cs
- RegexReplacement.cs
- AttributeCollection.cs
- MILUtilities.cs
- ApplicationProxyInternal.cs
- SafeFileHandle.cs
- sqlser.cs
- CodeDomDecompiler.cs
- PathBox.cs
- Debug.cs
- TreeNodeClickEventArgs.cs
- RightsManagementEncryptedStream.cs
- SemanticResolver.cs
- Signature.cs
- SmiContextFactory.cs
- XmlILOptimizerVisitor.cs
- AspCompat.cs
- DataPagerField.cs
- HandleExceptionArgs.cs
- SpellerStatusTable.cs
- ObjectMemberMapping.cs
- ExpressionEditorAttribute.cs
- HttpInputStream.cs
- ObjectComplexPropertyMapping.cs
- Rotation3D.cs
- Exception.cs
- PageClientProxyGenerator.cs
- newinstructionaction.cs
- TitleStyle.cs