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
- ReadOnlyPermissionSet.cs
- ContentPlaceHolder.cs
- DiffuseMaterial.cs
- MetadataPropertyvalue.cs
- DbConnectionOptions.cs
- DataReceivedEventArgs.cs
- DataAdapter.cs
- CellIdBoolean.cs
- EventLogEntryCollection.cs
- StringWriter.cs
- HtmlAnchor.cs
- EdmSchemaError.cs
- Stream.cs
- CalloutQueueItem.cs
- DataTrigger.cs
- ZipFileInfo.cs
- VisualStyleRenderer.cs
- altserialization.cs
- XmlSchema.cs
- DataBindingCollection.cs
- DecimalKeyFrameCollection.cs
- QilReference.cs
- OdbcEnvironment.cs
- PrimitiveXmlSerializers.cs
- CommonObjectSecurity.cs
- DbExpressionVisitor.cs
- CheckBoxDesigner.cs
- TableRow.cs
- NamespaceTable.cs
- FormsAuthenticationCredentials.cs
- TableCell.cs
- LinkedList.cs
- WizardStepBase.cs
- ScrollViewer.cs
- XmlBindingWorker.cs
- AsyncInvokeOperation.cs
- ColumnWidthChangedEvent.cs
- FacetValues.cs
- CodeArgumentReferenceExpression.cs
- ServiceDeploymentInfo.cs
- SqlDataSourceStatusEventArgs.cs
- EmbeddedMailObjectsCollection.cs
- Rotation3DAnimation.cs
- smtpconnection.cs
- Operator.cs
- ObjectSet.cs
- SettingsSection.cs
- WebPartZone.cs
- CompoundFileReference.cs
- TransformConverter.cs
- SqlVersion.cs
- OdbcConnectionPoolProviderInfo.cs
- Point3DKeyFrameCollection.cs
- StringResourceManager.cs
- PenLineCapValidation.cs
- Content.cs
- GPStream.cs
- LogPolicy.cs
- PreviewPageInfo.cs
- ValueQuery.cs
- CallbackBehaviorAttribute.cs
- _CacheStreams.cs
- ClipboardData.cs
- Base64Decoder.cs
- EntityDataSourceEntitySetNameItem.cs
- GenericIdentity.cs
- RawStylusInputReport.cs
- SafePEFileHandle.cs
- UserPreferenceChangedEventArgs.cs
- NetworkInformationPermission.cs
- MaterialCollection.cs
- Literal.cs
- FixedSOMPage.cs
- WindowsStatusBar.cs
- EmbeddedMailObjectsCollection.cs
- ECDiffieHellman.cs
- WebPermission.cs
- DataGridParentRows.cs
- SQLInt32Storage.cs
- ToolStripOverflow.cs
- XmlFormatExtensionAttribute.cs
- MatrixCamera.cs
- WSHttpSecurity.cs
- UIntPtr.cs
- sqlcontext.cs
- VectorConverter.cs
- NetworkStream.cs
- BoolLiteral.cs
- PageTheme.cs
- ApplicationCommands.cs
- CompilerScopeManager.cs
- CodeLabeledStatement.cs
- DriveNotFoundException.cs
- RegionInfo.cs
- WsatStrings.cs
- StructuredTypeEmitter.cs
- PageParserFilter.cs
- TextLineResult.cs
- ConnectionStringsSection.cs
- ColumnPropertiesGroup.cs