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
- ProfilePropertySettingsCollection.cs
- DivideByZeroException.cs
- Page.cs
- ImpersonationContext.cs
- Logging.cs
- CultureSpecificStringDictionary.cs
- DataGridCellsPresenter.cs
- RawStylusSystemGestureInputReport.cs
- DropTarget.cs
- DataGridAddNewRow.cs
- BackgroundFormatInfo.cs
- ServiceDeploymentInfo.cs
- objectquery_tresulttype.cs
- GorillaCodec.cs
- DashStyle.cs
- FactoryRecord.cs
- NamedPipeProcessProtocolHandler.cs
- AssemblyBuilder.cs
- OdbcFactory.cs
- HeaderedItemsControl.cs
- MenuItemAutomationPeer.cs
- KerberosTicketHashIdentifierClause.cs
- CfgSemanticTag.cs
- BaseAppDomainProtocolHandler.cs
- JoinGraph.cs
- TemplateBuilder.cs
- Int32RectConverter.cs
- SerializationInfo.cs
- SafeEventLogWriteHandle.cs
- KeyValueSerializer.cs
- StatusBarDrawItemEvent.cs
- objectquery_tresulttype.cs
- HorizontalAlignConverter.cs
- ListBox.cs
- Propagator.cs
- Int64AnimationUsingKeyFrames.cs
- DescendantOverDescendantQuery.cs
- XPathNavigator.cs
- CodeRegionDirective.cs
- CustomPeerResolverService.cs
- basevalidator.cs
- ListManagerBindingsCollection.cs
- WebControl.cs
- HttpAsyncResult.cs
- ParserOptions.cs
- XmlSortKey.cs
- PropertyBuilder.cs
- DesignerDataSchemaClass.cs
- Point.cs
- ToolStripGripRenderEventArgs.cs
- ResetableIterator.cs
- Timeline.cs
- DataGridLinkButton.cs
- ToolStripDropDownMenu.cs
- UnsafePeerToPeerMethods.cs
- HttpServerUtilityBase.cs
- FeatureManager.cs
- MutexSecurity.cs
- DecimalKeyFrameCollection.cs
- DbConnectionPool.cs
- BrowserInteropHelper.cs
- NameValueFileSectionHandler.cs
- BinaryConverter.cs
- XmlSchemaComplexContentRestriction.cs
- Win32.cs
- DataTableExtensions.cs
- SelectionGlyph.cs
- ProfileSection.cs
- NetworkInterface.cs
- KerberosSecurityTokenProvider.cs
- CategoryGridEntry.cs
- TreeViewItemAutomationPeer.cs
- ProcessHostConfigUtils.cs
- BasePattern.cs
- MethodCallConverter.cs
- StreamWriter.cs
- EmptyEnumerator.cs
- Matrix3DStack.cs
- TouchDevice.cs
- Merger.cs
- ItemsChangedEventArgs.cs
- MSAANativeProvider.cs
- MissingMemberException.cs
- AutomationPeer.cs
- HwndProxyElementProvider.cs
- DateTimeConverter.cs
- EncoderFallback.cs
- RC2CryptoServiceProvider.cs
- IriParsingElement.cs
- GridItem.cs
- XmlSchemaInclude.cs
- InkCanvasInnerCanvas.cs
- RecordConverter.cs
- SqlPersonalizationProvider.cs
- HttpValueCollection.cs
- EventLogEntry.cs
- AlternationConverter.cs
- DecoderReplacementFallback.cs
- DurableOperationContext.cs
- IsolatedStorage.cs