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
- StringResourceManager.cs
- DbParameterCollection.cs
- ZipIOLocalFileHeader.cs
- UndoManager.cs
- CdpEqualityComparer.cs
- TypefaceMetricsCache.cs
- SQLGuidStorage.cs
- mactripleDES.cs
- CompilationSection.cs
- glyphs.cs
- LayoutTable.cs
- StreamWriter.cs
- SatelliteContractVersionAttribute.cs
- PtsHelper.cs
- BrowserCapabilitiesFactoryBase.cs
- Lease.cs
- ExpandoObject.cs
- EnterpriseServicesHelper.cs
- ReferencedCategoriesDocument.cs
- IfAction.cs
- WorkflowApplicationEventArgs.cs
- MsmqAppDomainProtocolHandler.cs
- XsltLoader.cs
- BmpBitmapDecoder.cs
- Overlapped.cs
- ImageListUtils.cs
- ErrorWrapper.cs
- WebPartConnectionsConfigureVerb.cs
- AppDomainManager.cs
- CommentEmitter.cs
- SmtpFailedRecipientsException.cs
- FrameworkElement.cs
- DataTableCollection.cs
- ListViewUpdatedEventArgs.cs
- GcHandle.cs
- AmbientLight.cs
- ImageCreator.cs
- SnapLine.cs
- AstTree.cs
- PropertyGeneratedEventArgs.cs
- NativeMethodsCLR.cs
- StrokeNodeOperations.cs
- BooleanKeyFrameCollection.cs
- StrongNamePublicKeyBlob.cs
- CharacterMetricsDictionary.cs
- XmlAttributeAttribute.cs
- FileSystemEventArgs.cs
- ConnectionStringSettingsCollection.cs
- RepeatInfo.cs
- ISAPIWorkerRequest.cs
- IndexerNameAttribute.cs
- GenericTextProperties.cs
- IssuanceLicense.cs
- XmlSchemaGroup.cs
- XamlReaderConstants.cs
- HttpException.cs
- Range.cs
- XamlStream.cs
- SelectionProcessor.cs
- PerformanceCountersElement.cs
- _NestedSingleAsyncResult.cs
- LiteralSubsegment.cs
- DoubleLinkList.cs
- ContentValidator.cs
- NativeBuffer.cs
- HandleCollector.cs
- ListParagraph.cs
- ServiceHttpHandlerFactory.cs
- XmlSerializerNamespaces.cs
- ActiveXHelper.cs
- ApplicationInfo.cs
- QuaternionKeyFrameCollection.cs
- HttpPostClientProtocol.cs
- StylusPointPropertyInfoDefaults.cs
- SystemThemeKey.cs
- ExpressionBindingCollection.cs
- HttpApplicationFactory.cs
- TextEditorTables.cs
- Utils.cs
- MeasurementDCInfo.cs
- TreeViewImageGenerator.cs
- PrintControllerWithStatusDialog.cs
- AutomationPeer.cs
- Monitor.cs
- EntitySetRetriever.cs
- HttpContext.cs
- Match.cs
- TransformPattern.cs
- DataSourceControl.cs
- DesignerTextWriter.cs
- SuppressIldasmAttribute.cs
- ValidationRuleCollection.cs
- ReadWriteObjectLock.cs
- BinaryFormatter.cs
- EntitySet.cs
- PropertyNames.cs
- HtmlToClrEventProxy.cs
- TextParagraphView.cs
- ToolStripDropDownClosingEventArgs.cs
- UriWriter.cs