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
- FixedFlowMap.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ToolBar.cs
- GridViewRow.cs
- ListBoxItemAutomationPeer.cs
- EventProxy.cs
- IDReferencePropertyAttribute.cs
- LassoHelper.cs
- CommandLibraryHelper.cs
- MetadataPropertyAttribute.cs
- SecurityImpersonationBehavior.cs
- ContainerParagraph.cs
- DbConnectionFactory.cs
- SqlParameterizer.cs
- PropertyToken.cs
- XMLUtil.cs
- PopupControlService.cs
- DbConnectionClosed.cs
- SystemColors.cs
- LocalizableResourceBuilder.cs
- Types.cs
- httpstaticobjectscollection.cs
- KnownTypesHelper.cs
- ExceptionHandlers.cs
- SafeMarshalContext.cs
- FixedSOMSemanticBox.cs
- WindowsPrincipal.cs
- FileLoadException.cs
- XmlAttributeHolder.cs
- XmlDeclaration.cs
- MSAANativeProvider.cs
- CodeIdentifier.cs
- DataGridViewRowHeaderCell.cs
- DurableInstanceProvider.cs
- DataTableCollection.cs
- WebPart.cs
- GeometryHitTestParameters.cs
- BaseCodePageEncoding.cs
- CodeIterationStatement.cs
- SpellCheck.cs
- ProfilePropertyMetadata.cs
- TimeSpanValidator.cs
- EntityDataSourceView.cs
- OptimizedTemplateContentHelper.cs
- HttpModuleCollection.cs
- ItemsControl.cs
- WebPartUtil.cs
- MatrixConverter.cs
- SQLDoubleStorage.cs
- Style.cs
- HttpChannelHelper.cs
- UnsafeNativeMethods.cs
- TcpServerChannel.cs
- FlowSwitchDesigner.xaml.cs
- ForceCopyBuildProvider.cs
- PolyLineSegment.cs
- SecurityElement.cs
- unsafenativemethodsother.cs
- DelegatingConfigHost.cs
- Propagator.Evaluator.cs
- _LazyAsyncResult.cs
- ListViewInsertionMark.cs
- PointLight.cs
- RijndaelManaged.cs
- SqlPersonalizationProvider.cs
- AttributeTable.cs
- HijriCalendar.cs
- StructuredTypeInfo.cs
- SecurityManager.cs
- EntityDataSourceMemberPath.cs
- XamlVector3DCollectionSerializer.cs
- BitmapImage.cs
- EdmToObjectNamespaceMap.cs
- FunctionNode.cs
- WebPartConnectionsConfigureVerb.cs
- PathTooLongException.cs
- Verify.cs
- UITypeEditor.cs
- ExtensionWindow.cs
- BorderGapMaskConverter.cs
- OutputCacheProfile.cs
- QuotedPrintableStream.cs
- QueryResults.cs
- DateTimeUtil.cs
- Separator.cs
- formatter.cs
- CLSCompliantAttribute.cs
- TypeToTreeConverter.cs
- FragmentQueryKB.cs
- WorkflowTimerService.cs
- SpeechRecognizer.cs
- NumberFunctions.cs
- ClientTargetCollection.cs
- SystemBrushes.cs
- EventDescriptorCollection.cs
- FactoryId.cs
- StrokeDescriptor.cs
- InfoCardSymmetricCrypto.cs
- XmlElementList.cs
- HttpContext.cs