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
- PageTheme.cs
- OwnerDrawPropertyBag.cs
- ColorConvertedBitmapExtension.cs
- SQLInt64Storage.cs
- StateChangeEvent.cs
- PrefixQName.cs
- SoapElementAttribute.cs
- DesignOnlyAttribute.cs
- BitmapCodecInfo.cs
- UnknownBitmapEncoder.cs
- ImageAttributes.cs
- ConnectionPoint.cs
- XmlElementList.cs
- BooleanProjectedSlot.cs
- invalidudtexception.cs
- DBSchemaRow.cs
- CultureTableRecord.cs
- TrustLevel.cs
- NamedPermissionSet.cs
- MemoryRecordBuffer.cs
- FakeModelItemImpl.cs
- InvalidateEvent.cs
- Rectangle.cs
- MsmqOutputSessionChannel.cs
- SqlDataSource.cs
- MappingSource.cs
- SqlServices.cs
- AssociationTypeEmitter.cs
- DisposableCollectionWrapper.cs
- TickBar.cs
- AuthenticationModuleElement.cs
- CompoundFileIOPermission.cs
- ConvertTextFrag.cs
- SubtreeProcessor.cs
- InvariantComparer.cs
- ConnectionStringsExpressionBuilder.cs
- GorillaCodec.cs
- CatalogPart.cs
- DataGridViewDataErrorEventArgs.cs
- XmlQueryTypeFactory.cs
- TypeReference.cs
- HtmlInputRadioButton.cs
- XmlParser.cs
- ContextMenu.cs
- BitmapImage.cs
- Color.cs
- RuntimeWrappedException.cs
- FormViewPageEventArgs.cs
- DbBuffer.cs
- XmlSignatureManifest.cs
- ContextMenuService.cs
- DataServiceRequest.cs
- ManipulationDevice.cs
- XamlInterfaces.cs
- TextFormatterHost.cs
- Latin1Encoding.cs
- ToolStripItemTextRenderEventArgs.cs
- DoubleCollectionValueSerializer.cs
- SqlTransaction.cs
- EarlyBoundInfo.cs
- ListViewGroup.cs
- IOThreadScheduler.cs
- BuildProviderAppliesToAttribute.cs
- WebBaseEventKeyComparer.cs
- PageRanges.cs
- DataGridViewCellEventArgs.cs
- RoleGroup.cs
- FontResourceCache.cs
- SmtpMail.cs
- SqlFacetAttribute.cs
- ControlType.cs
- SchemaObjectWriter.cs
- EventListener.cs
- BamlRecordWriter.cs
- TableSectionStyle.cs
- XmlBinaryWriterSession.cs
- IntPtr.cs
- QueryContinueDragEventArgs.cs
- TextCollapsingProperties.cs
- ServiceProviders.cs
- BaseTreeIterator.cs
- XmlMtomWriter.cs
- LinkUtilities.cs
- SystemParameters.cs
- TextCollapsingProperties.cs
- WrapPanel.cs
- ContentDisposition.cs
- CollectionConverter.cs
- RepeatInfo.cs
- COMException.cs
- DatatypeImplementation.cs
- PathFigureCollection.cs
- BitmapCodecInfo.cs
- PkcsMisc.cs
- ServiceInstanceProvider.cs
- EmissiveMaterial.cs
- XmlSchemaAnnotation.cs
- ThreadInterruptedException.cs
- ProcessThreadCollection.cs
- ConnectionPointGlyph.cs