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
- SendActivityDesigner.cs
- StateMachine.cs
- SqlColumnizer.cs
- DataRelationCollection.cs
- FilteredAttributeCollection.cs
- ConsoleCancelEventArgs.cs
- LocalizedNameDescriptionPair.cs
- AdornerHitTestResult.cs
- documentsequencetextpointer.cs
- DecimalKeyFrameCollection.cs
- SecurityTokenSerializer.cs
- StylusLogic.cs
- DataGridViewColumnCollection.cs
- DirectoryObjectSecurity.cs
- Baml6ConstructorInfo.cs
- DefaultMergeHelper.cs
- CodeSpit.cs
- LoginName.cs
- QilInvokeLateBound.cs
- ImageDrawing.cs
- DocumentProperties.cs
- HttpGetProtocolReflector.cs
- MembershipPasswordException.cs
- JournalNavigationScope.cs
- OpenTypeLayoutCache.cs
- XmlEncodedRawTextWriter.cs
- AuthenticateEventArgs.cs
- FilterQuery.cs
- ContentElement.cs
- SourceLineInfo.cs
- IndicShape.cs
- PartitionedStream.cs
- HtmlTable.cs
- TreePrinter.cs
- CopyOnWriteList.cs
- HiddenFieldPageStatePersister.cs
- EntityParameterCollection.cs
- MulticastDelegate.cs
- PinnedBufferMemoryStream.cs
- GroupItemAutomationPeer.cs
- OutputCacheSettings.cs
- MediaCommands.cs
- SatelliteContractVersionAttribute.cs
- ResourceManagerWrapper.cs
- Number.cs
- System.Data_BID.cs
- TextParaClient.cs
- IDReferencePropertyAttribute.cs
- ColumnPropertiesGroup.cs
- DataSourceControlBuilder.cs
- FixedSOMPageElement.cs
- Point.cs
- MultiView.cs
- _AutoWebProxyScriptWrapper.cs
- BaseDataListDesigner.cs
- GuidelineSet.cs
- ArrayWithOffset.cs
- IdentityManager.cs
- AssemblyResourceLoader.cs
- AutomationPropertyInfo.cs
- InheritanceContextChangedEventManager.cs
- LongMinMaxAggregationOperator.cs
- BufferedGraphics.cs
- SerializationObjectManager.cs
- Config.cs
- FixedSOMTextRun.cs
- ArgumentDirectionHelper.cs
- BasicKeyConstraint.cs
- ListSourceHelper.cs
- DataBoundControl.cs
- TouchFrameEventArgs.cs
- SqlDataSourceCommandEventArgs.cs
- UnsafeNativeMethods.cs
- VisualBasicSettingsHandler.cs
- JournalEntryStack.cs
- HtmlForm.cs
- Point3D.cs
- XPathScanner.cs
- CommandConverter.cs
- UInt64.cs
- XmlSchemaComplexType.cs
- LinearGradientBrush.cs
- ConfigurationPermission.cs
- XmlCharType.cs
- ListBindingHelper.cs
- BindingSource.cs
- ControlPropertyNameConverter.cs
- FormParameter.cs
- CompoundFileReference.cs
- _OSSOCK.cs
- WorkflowQueuingService.cs
- ProcessHostServerConfig.cs
- DefaultTraceListener.cs
- ListViewUpdatedEventArgs.cs
- Variant.cs
- Point3DConverter.cs
- DatagridviewDisplayedBandsData.cs
- DatePickerTextBox.cs
- RootDesignerSerializerAttribute.cs
- GPPOINTF.cs