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
- HealthMonitoringSectionHelper.cs
- TimeSpanStorage.cs
- AudioFormatConverter.cs
- ScrollData.cs
- SafeCloseHandleCritical.cs
- ConstructorExpr.cs
- OleDbCommandBuilder.cs
- WebPartMinimizeVerb.cs
- CodeDomSerializationProvider.cs
- _AutoWebProxyScriptWrapper.cs
- ScrollBarRenderer.cs
- CircleHotSpot.cs
- SeparatorAutomationPeer.cs
- PropertyGridCommands.cs
- TypeUtils.cs
- RegistryKey.cs
- ManipulationVelocities.cs
- SoundPlayerAction.cs
- ConfigurationSectionGroup.cs
- MenuItem.cs
- EdmRelationshipRoleAttribute.cs
- ToolStripItemRenderEventArgs.cs
- BigInt.cs
- SourceElementsCollection.cs
- SafeHandle.cs
- CacheOutputQuery.cs
- AppModelKnownContentFactory.cs
- ControlCachePolicy.cs
- _LoggingObject.cs
- OrderByQueryOptionExpression.cs
- CompilerErrorCollection.cs
- DataGridColumnHeadersPresenter.cs
- BindingNavigatorDesigner.cs
- NumericUpDownAcceleration.cs
- CalendarData.cs
- RegexWorker.cs
- PrincipalPermission.cs
- EncodingTable.cs
- WebPartZoneBase.cs
- ConnectorEditor.cs
- ListBoxAutomationPeer.cs
- DATA_BLOB.cs
- IssuedTokenParametersEndpointAddressElement.cs
- SystemColors.cs
- ComboBoxRenderer.cs
- CustomAttributeFormatException.cs
- LayoutDump.cs
- DataSourceCache.cs
- SystemColors.cs
- ScriptRegistrationManager.cs
- VariantWrapper.cs
- PluralizationServiceUtil.cs
- COM2ICategorizePropertiesHandler.cs
- SharedPersonalizationStateInfo.cs
- UseAttributeSetsAction.cs
- FixUp.cs
- MarginCollapsingState.cs
- OutputWindow.cs
- SerializationObjectManager.cs
- SchemaNames.cs
- AccessDataSource.cs
- CachedCompositeFamily.cs
- CustomErrorCollection.cs
- RequestBringIntoViewEventArgs.cs
- SqlDataSourceFilteringEventArgs.cs
- PolyQuadraticBezierSegment.cs
- FolderLevelBuildProvider.cs
- WindowsListViewItemStartMenu.cs
- XmlStreamStore.cs
- Gdiplus.cs
- SemanticBasicElement.cs
- ValidationErrorCollection.cs
- AgileSafeNativeMemoryHandle.cs
- DynamicObjectAccessor.cs
- SrgsDocument.cs
- GregorianCalendar.cs
- DataExpression.cs
- PrivacyNoticeElement.cs
- MobileControlBuilder.cs
- DataBindEngine.cs
- SyntaxCheck.cs
- FieldNameLookup.cs
- DataGridAutoFormatDialog.cs
- VirtualDirectoryMappingCollection.cs
- CodeGotoStatement.cs
- CreateUserErrorEventArgs.cs
- SamlSecurityTokenAuthenticator.cs
- ReadOnlyDictionary.cs
- Thread.cs
- AdapterUtil.cs
- SystemResourceKey.cs
- SettingsBase.cs
- SessionStateSection.cs
- Native.cs
- EdmError.cs
- _OSSOCK.cs
- CounterSampleCalculator.cs
- Table.cs
- RotateTransform3D.cs
- FileBasedResourceGroveler.cs