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
- WorkflowServiceBuildProvider.cs
- DataControlLinkButton.cs
- DbDeleteCommandTree.cs
- SmtpNegotiateAuthenticationModule.cs
- PackWebResponse.cs
- StringResourceManager.cs
- IconHelper.cs
- KeyInstance.cs
- AnimationLayer.cs
- PrimarySelectionAdorner.cs
- WebPartAddingEventArgs.cs
- QueryRelOp.cs
- AutoResizedEvent.cs
- Cell.cs
- ContentFilePart.cs
- DataProtection.cs
- GcSettings.cs
- ConfigurationSettings.cs
- FileDialogCustomPlace.cs
- XmlSchemaSimpleType.cs
- dsa.cs
- Properties.cs
- IUnknownConstantAttribute.cs
- LayoutSettings.cs
- SynchronizingStream.cs
- objectquery_tresulttype.cs
- AdPostCacheSubstitution.cs
- FixedSOMPageConstructor.cs
- TraceSection.cs
- XmlWrappingReader.cs
- VirtualDirectoryMapping.cs
- CustomErrorsSection.cs
- KeyPullup.cs
- ProcessStartInfo.cs
- AddInIpcChannel.cs
- MouseActionValueSerializer.cs
- PictureBox.cs
- SettingsPropertyValue.cs
- StateManagedCollection.cs
- MruCache.cs
- SiteMap.cs
- TimeSpanParse.cs
- PhysicalOps.cs
- ParameterBuilder.cs
- PrinterUnitConvert.cs
- SystemUdpStatistics.cs
- MessageRpc.cs
- HMAC.cs
- WebPartConnectionsConfigureVerb.cs
- LongValidator.cs
- IconEditor.cs
- SqlProfileProvider.cs
- SafeFileMapViewHandle.cs
- BufferedGraphicsContext.cs
- PropertyMapper.cs
- OperatingSystemVersionCheck.cs
- ListView.cs
- Animatable.cs
- EntityDataReader.cs
- ComContractElementCollection.cs
- oledbmetadatacollectionnames.cs
- ZoomingMessageFilter.cs
- XhtmlCssHandler.cs
- PackageRelationship.cs
- Int32Storage.cs
- ReceiveCompletedEventArgs.cs
- TreeBuilderXamlTranslator.cs
- shaper.cs
- UnsafeNativeMethods.cs
- UrlPropertyAttribute.cs
- FormsAuthenticationUserCollection.cs
- _TransmitFileOverlappedAsyncResult.cs
- MethodBuilderInstantiation.cs
- BinaryFormatter.cs
- ISAPIRuntime.cs
- SqlVersion.cs
- BinaryWriter.cs
- SoapHeader.cs
- UserControlCodeDomTreeGenerator.cs
- TypeConverter.cs
- DisplayMemberTemplateSelector.cs
- RIPEMD160Managed.cs
- Synchronization.cs
- ForceCopyBuildProvider.cs
- FontNamesConverter.cs
- Translator.cs
- Polygon.cs
- PageStatePersister.cs
- ToolStripArrowRenderEventArgs.cs
- ConditionalExpression.cs
- RelationshipDetailsRow.cs
- TextServicesManager.cs
- Simplifier.cs
- CodeBlockBuilder.cs
- EntityKeyElement.cs
- TypeName.cs
- PropertyItemInternal.cs
- BindableAttribute.cs
- WindowVisualStateTracker.cs
- EntityType.cs