Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _SSPISessionCache.cs / 1305376 / _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()); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaDatatype.cs
- IntegerCollectionEditor.cs
- DataGridViewCheckBoxCell.cs
- EDesignUtil.cs
- WebScriptClientGenerator.cs
- DataServiceClientException.cs
- Menu.cs
- HtmlTableCellCollection.cs
- BamlRecordReader.cs
- ServerValidateEventArgs.cs
- RelationalExpressions.cs
- UTF8Encoding.cs
- ObjectConverter.cs
- SharedPerformanceCounter.cs
- UnsafeNativeMethods.cs
- Speller.cs
- RangeBaseAutomationPeer.cs
- KoreanCalendar.cs
- RotateTransform3D.cs
- RepeaterItemEventArgs.cs
- FormClosedEvent.cs
- EnumMember.cs
- UpDownEvent.cs
- HostingPreferredMapPath.cs
- SafeNativeMethods.cs
- AsynchronousChannel.cs
- AppDomain.cs
- DefaultEventAttribute.cs
- FixedSOMPage.cs
- webproxy.cs
- ViewBox.cs
- DbConnectionInternal.cs
- IntellisenseTextBox.cs
- Dump.cs
- IssuanceTokenProviderBase.cs
- DetailsViewDeleteEventArgs.cs
- WebBaseEventKeyComparer.cs
- DataServiceClientException.cs
- OrderByLifter.cs
- EUCJPEncoding.cs
- TraceFilter.cs
- OracleEncoding.cs
- CollectionConverter.cs
- UIElement3D.cs
- CellPartitioner.cs
- DataObjectAttribute.cs
- OpacityConverter.cs
- SqlBuilder.cs
- HtmlInputButton.cs
- URL.cs
- ElementNotAvailableException.cs
- ScriptIgnoreAttribute.cs
- baseshape.cs
- BinaryFormatter.cs
- Pool.cs
- XmlAttributeAttribute.cs
- ObjectListField.cs
- HWStack.cs
- CodeMemberProperty.cs
- ProfilePropertySettingsCollection.cs
- ExeConfigurationFileMap.cs
- EventPrivateKey.cs
- EventSetter.cs
- CheckPair.cs
- PresentationTraceSources.cs
- XmlWrappingReader.cs
- Pen.cs
- UnsafeNativeMethods.cs
- QueryExpr.cs
- RootNamespaceAttribute.cs
- TextTreeTextBlock.cs
- LogicalChannelCollection.cs
- ListItemCollection.cs
- FontWeights.cs
- LayoutInformation.cs
- ElementUtil.cs
- ExtractorMetadata.cs
- ComponentDispatcher.cs
- SqlNotificationRequest.cs
- RepeaterItem.cs
- RenderCapability.cs
- ParameterCollectionEditor.cs
- ConnectionInterfaceCollection.cs
- ReachFixedDocumentSerializer.cs
- COM2PropertyDescriptor.cs
- CommentGlyph.cs
- HtmlElementCollection.cs
- RenderContext.cs
- TypeBuilderInstantiation.cs
- StylusCollection.cs
- WebDisplayNameAttribute.cs
- GridViewCommandEventArgs.cs
- DataTableMappingCollection.cs
- RenderData.cs
- NgenServicingAttributes.cs
- DrawingContextWalker.cs
- OleDbTransaction.cs
- SqlCommand.cs
- MessageVersionConverter.cs
- AsyncResult.cs