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
- IResourceProvider.cs
- Paragraph.cs
- PrivilegedConfigurationManager.cs
- PersonalizationStateInfoCollection.cs
- NestedContainer.cs
- XmlSchemaType.cs
- Vector3DCollectionConverter.cs
- MatrixIndependentAnimationStorage.cs
- ErrorHandlingAcceptor.cs
- EmissiveMaterial.cs
- Preprocessor.cs
- ByteStreamGeometryContext.cs
- SyndicationElementExtensionCollection.cs
- XmlCodeExporter.cs
- DoubleCollection.cs
- FormDocumentDesigner.cs
- ReleaseInstanceMode.cs
- ModelChangedEventArgsImpl.cs
- CodeSubDirectory.cs
- HealthMonitoringSection.cs
- XamlInt32CollectionSerializer.cs
- PersonalizationStateInfoCollection.cs
- StringUtil.cs
- AutoScrollExpandMessageFilter.cs
- httpserverutility.cs
- ModifierKeysConverter.cs
- SQLDoubleStorage.cs
- SQLMoneyStorage.cs
- DetailsViewAutoFormat.cs
- ComponentSerializationService.cs
- FragmentQuery.cs
- ToolStripDropDown.cs
- CaseDesigner.xaml.cs
- DesignerMetadata.cs
- Helpers.cs
- OrderedEnumerableRowCollection.cs
- RbTree.cs
- BaseCodePageEncoding.cs
- BaseTreeIterator.cs
- _ConnectOverlappedAsyncResult.cs
- COMException.cs
- TransformFinalBlockRequest.cs
- ApplyImportsAction.cs
- RelativeSource.cs
- MULTI_QI.cs
- DesignObjectWrapper.cs
- TrackingStringDictionary.cs
- MetadataHelper.cs
- UnmanagedMarshal.cs
- TableAdapterManagerNameHandler.cs
- XhtmlConformanceSection.cs
- _NestedSingleAsyncResult.cs
- OdbcEnvironmentHandle.cs
- PenCursorManager.cs
- CodeCastExpression.cs
- Int64Animation.cs
- ObjectItemNoOpAssemblyLoader.cs
- WindowsRichEditRange.cs
- EdmSchemaAttribute.cs
- ApplicationFileCodeDomTreeGenerator.cs
- OdbcConnection.cs
- ECDiffieHellmanCngPublicKey.cs
- ItemsControl.cs
- DetailsViewDeletedEventArgs.cs
- SourceElementsCollection.cs
- TableLayoutSettingsTypeConverter.cs
- SqlDataAdapter.cs
- SharedPerformanceCounter.cs
- Header.cs
- SortedSetDebugView.cs
- BulletedList.cs
- ProcessInfo.cs
- ToolStripDropTargetManager.cs
- IdentityReference.cs
- SequenceQuery.cs
- TextAutomationPeer.cs
- X509PeerCertificateAuthenticationElement.cs
- ActivityExecutionWorkItem.cs
- DesigntimeLicenseContext.cs
- MemoryRecordBuffer.cs
- SecurityTokenResolver.cs
- RightsManagementResourceHelper.cs
- ValueConversionAttribute.cs
- HashStream.cs
- InstallerTypeAttribute.cs
- CorrelationKeyCalculator.cs
- ClientSection.cs
- SchemaImporter.cs
- CompressStream.cs
- DecimalConverter.cs
- PtsHelper.cs
- PeerReferralPolicy.cs
- FormatterServices.cs
- TextParagraphCache.cs
- RoleGroupCollection.cs
- ParameterCollection.cs
- PropertyKey.cs
- PrinterResolution.cs
- CheckBoxRenderer.cs
- CodeTypeDeclarationCollection.cs