Code:
/ FX-1434 / FX-1434 / 1.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
- ProtectedConfigurationSection.cs
- BindingMAnagerBase.cs
- ListBox.cs
- TypeCacheManager.cs
- ReadOnlyPropertyMetadata.cs
- DataKey.cs
- AnnotationComponentManager.cs
- BindableAttribute.cs
- UInt64.cs
- EventLogPermission.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- TypeProvider.cs
- CultureSpecificStringDictionary.cs
- PropertyPushdownHelper.cs
- SByteConverter.cs
- Compilation.cs
- AutomationElement.cs
- MenuItemStyleCollection.cs
- ParallelTimeline.cs
- TouchDevice.cs
- DataControlCommands.cs
- ImageMap.cs
- Comparer.cs
- BaseCAMarshaler.cs
- ThreadNeutralSemaphore.cs
- Quaternion.cs
- XmlBufferedByteStreamReader.cs
- RuntimeConfig.cs
- DefaultHttpHandler.cs
- ToolStripControlHost.cs
- ToolStripContainer.cs
- NativeMethods.cs
- BrushConverter.cs
- MemoryRecordBuffer.cs
- SmiTypedGetterSetter.cs
- SystemIPv4InterfaceProperties.cs
- VariableQuery.cs
- Storyboard.cs
- FixedStringLookup.cs
- VisualBasicExpressionConverter.cs
- HtmlFormWrapper.cs
- XmlTypeMapping.cs
- WSFederationHttpBinding.cs
- KeyEventArgs.cs
- EdmItemCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- DoubleLink.cs
- SqlParameterizer.cs
- DigestTraceRecordHelper.cs
- MetadataSerializer.cs
- DrawingContextDrawingContextWalker.cs
- DataGridColumnCollection.cs
- TextTreeUndo.cs
- ExtendedTransformFactory.cs
- InkCanvasSelectionAdorner.cs
- SelectQueryOperator.cs
- ByteStreamMessageEncoderFactory.cs
- rsa.cs
- CategoriesDocumentFormatter.cs
- DbModificationCommandTree.cs
- NeutralResourcesLanguageAttribute.cs
- StyleBamlTreeBuilder.cs
- DataViewListener.cs
- cache.cs
- PageStatePersister.cs
- MatrixAnimationUsingKeyFrames.cs
- CodeParameterDeclarationExpression.cs
- EntityParameter.cs
- XamlPoint3DCollectionSerializer.cs
- XmlSerializationReader.cs
- MediaTimeline.cs
- CommandValueSerializer.cs
- PrintDialogException.cs
- ADConnectionHelper.cs
- NamespaceTable.cs
- NullableFloatMinMaxAggregationOperator.cs
- _TimerThread.cs
- SqlTypesSchemaImporter.cs
- X509ChainPolicy.cs
- ChildChangedEventArgs.cs
- NamespaceTable.cs
- MSHTMLHostUtil.cs
- IImplicitResourceProvider.cs
- WindowsRebar.cs
- ReadOnlyAttribute.cs
- ExceptionHelpers.cs
- BindingGroup.cs
- DecimalConverter.cs
- ToolStripOverflowButton.cs
- DataGridPageChangedEventArgs.cs
- WorkflowHostingResponseContext.cs
- EditorAttribute.cs
- BamlLocalizabilityResolver.cs
- ComponentEvent.cs
- IODescriptionAttribute.cs
- ArgumentFixer.cs
- AutomationPropertyInfo.cs
- ConnectionManagementElement.cs
- TiffBitmapDecoder.cs
- XmlSchemaInferenceException.cs