Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _SSPISessionCache.cs / 1305376 / _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()); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AdornerLayer.cs
- Shared.cs
- ProtocolException.cs
- StaticExtensionConverter.cs
- NamedPipeChannelListener.cs
- ColorKeyFrameCollection.cs
- HttpListenerContext.cs
- GcHandle.cs
- VerticalAlignConverter.cs
- EastAsianLunisolarCalendar.cs
- ContextMenu.cs
- RefreshResponseInfo.cs
- ObjectHandle.cs
- PeerToPeerException.cs
- SharedStatics.cs
- DynamicILGenerator.cs
- DbDeleteCommandTree.cs
- DesignObjectWrapper.cs
- MarkedHighlightComponent.cs
- ClientSideProviderDescription.cs
- SeekStoryboard.cs
- FactoryGenerator.cs
- UnsafeNativeMethods.cs
- NamedObject.cs
- BitStack.cs
- LayoutEditorPart.cs
- OneWayElement.cs
- DataSourceSelectArguments.cs
- ManagementQuery.cs
- FontResourceCache.cs
- KnownIds.cs
- Variable.cs
- DynamicQueryableWrapper.cs
- DockProviderWrapper.cs
- Attributes.cs
- ComponentSerializationService.cs
- SymbolEqualComparer.cs
- PrimitiveSchema.cs
- SoapReflectionImporter.cs
- XmlSerializerFactory.cs
- SchemaNotation.cs
- Menu.cs
- ServiceSecurityAuditBehavior.cs
- RemoteWebConfigurationHostStream.cs
- ImageKeyConverter.cs
- SystemEvents.cs
- ProjectionAnalyzer.cs
- TreeViewDataItemAutomationPeer.cs
- PerformanceCounterLib.cs
- login.cs
- SiteMapProvider.cs
- ChoiceConverter.cs
- AnnotationResourceChangedEventArgs.cs
- MobileControlsSection.cs
- WebPartMovingEventArgs.cs
- ButtonFlatAdapter.cs
- XmlAttributeOverrides.cs
- XmlSchemaDocumentation.cs
- ListViewPagedDataSource.cs
- ProxyFragment.cs
- NavigationPropertyEmitter.cs
- BaseEntityWrapper.cs
- BrowsableAttribute.cs
- MdiWindowListStrip.cs
- FixedDSBuilder.cs
- SecureStringHasher.cs
- XmlNullResolver.cs
- Constants.cs
- ItemsControlAutomationPeer.cs
- QuotedStringFormatReader.cs
- TextContainerHelper.cs
- PersonalizableTypeEntry.cs
- AuthorizationSection.cs
- FixedPageStructure.cs
- GraphicsPathIterator.cs
- ListDictionary.cs
- FacetChecker.cs
- FlowDocumentReaderAutomationPeer.cs
- CompoundFileDeflateTransform.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- ShaderEffect.cs
- FamilyCollection.cs
- HttpModuleActionCollection.cs
- LoginCancelEventArgs.cs
- PolyBezierSegment.cs
- SerializationFieldInfo.cs
- AccessedThroughPropertyAttribute.cs
- ToolStripPanelRenderEventArgs.cs
- StrokeSerializer.cs
- MexHttpsBindingCollectionElement.cs
- ValueTable.cs
- ImpersonationContext.cs
- HttpHandlerActionCollection.cs
- InvokeBase.cs
- TableLayoutStyle.cs
- GenericArgumentsUpdater.cs
- ImageAutomationPeer.cs
- Validator.cs
- Track.cs
- PeerName.cs