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
- Collection.cs
- SettingsSection.cs
- TextClipboardData.cs
- TextureBrush.cs
- Profiler.cs
- TreeBuilder.cs
- ImageIndexConverter.cs
- BitmapScalingModeValidation.cs
- WebScriptMetadataMessageEncoderFactory.cs
- QueryConverter.cs
- MsmqIntegrationProcessProtocolHandler.cs
- HtmlFormAdapter.cs
- XmlMembersMapping.cs
- CompilerError.cs
- DbConnectionPoolGroup.cs
- WebBrowsableAttribute.cs
- CustomMenuItemCollection.cs
- RoutedEventConverter.cs
- Rules.cs
- PriorityItem.cs
- ToolCreatedEventArgs.cs
- DuplicateDetector.cs
- WebServiceClientProxyGenerator.cs
- TypefaceMap.cs
- unsafenativemethodstextservices.cs
- CodeGenerator.cs
- TailCallAnalyzer.cs
- DataGridViewComboBoxEditingControl.cs
- IDReferencePropertyAttribute.cs
- FormViewUpdateEventArgs.cs
- SmtpMail.cs
- SingleAnimationBase.cs
- StringConverter.cs
- QueryOutputWriter.cs
- complextypematerializer.cs
- ResXFileRef.cs
- HashHelpers.cs
- LinearKeyFrames.cs
- DataGridClipboardCellContent.cs
- MaterialCollection.cs
- EventDescriptor.cs
- ListDesigner.cs
- ArgumentException.cs
- _RequestLifetimeSetter.cs
- SharedDp.cs
- UnsafeNativeMethods.cs
- RemotingConfiguration.cs
- UiaCoreApi.cs
- Mapping.cs
- StopRoutingHandler.cs
- X509SecurityTokenParameters.cs
- InvalidPrinterException.cs
- TextWriterTraceListener.cs
- LineGeometry.cs
- PrimitiveType.cs
- EditorPartCollection.cs
- CommandDevice.cs
- ConfigurationLockCollection.cs
- SpoolingTask.cs
- XmlSchemaSimpleType.cs
- ExtentKey.cs
- DataGridDesigner.cs
- MemoryPressure.cs
- ConnectionsZone.cs
- GacUtil.cs
- DbCommandTree.cs
- GridViewUpdatedEventArgs.cs
- linebase.cs
- TcpSocketManager.cs
- RegexRunnerFactory.cs
- ExeContext.cs
- SqlClientWrapperSmiStream.cs
- TableLayoutRowStyleCollection.cs
- RoleManagerEventArgs.cs
- TemplateKeyConverter.cs
- TextBox.cs
- GeneralTransformGroup.cs
- OleDbDataAdapter.cs
- ArrangedElementCollection.cs
- Int32CAMarshaler.cs
- WpfMemberInvoker.cs
- KeyNotFoundException.cs
- OperationExecutionFault.cs
- BamlResourceSerializer.cs
- SmtpReplyReader.cs
- RecommendedAsConfigurableAttribute.cs
- AssemblyCollection.cs
- SqlTriggerContext.cs
- JobCollate.cs
- ProviderException.cs
- DefaultAuthorizationContext.cs
- SectionVisual.cs
- ServiceNameCollection.cs
- Error.cs
- ServiceModelReg.cs
- DataBindingCollection.cs
- ExtensibleClassFactory.cs
- Number.cs
- TextParaClient.cs
- SqlDataSourceCache.cs