Code:
/ FX-1434 / FX-1434 / 1.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
- ListParagraph.cs
- DbMetaDataFactory.cs
- LZCodec.cs
- SafeViewOfFileHandle.cs
- PageTheme.cs
- Journaling.cs
- ToolStripContentPanel.cs
- login.cs
- ControlsConfig.cs
- PointAnimationBase.cs
- SingleAnimation.cs
- TableCellCollection.cs
- Registry.cs
- SchemaImporterExtension.cs
- MemoryStream.cs
- NetMsmqSecurity.cs
- TcpTransportSecurity.cs
- SecurityKeyType.cs
- ValidatingReaderNodeData.cs
- RegistryHandle.cs
- AspNetRouteServiceHttpHandler.cs
- FillErrorEventArgs.cs
- ControlValuePropertyAttribute.cs
- MethodBuilderInstantiation.cs
- EnumType.cs
- StyleBamlRecordReader.cs
- NestPullup.cs
- SequenceQuery.cs
- XsltFunctions.cs
- DirectoryRedirect.cs
- XPathDocumentBuilder.cs
- XNodeSchemaApplier.cs
- DeviceFiltersSection.cs
- ToolboxItemImageConverter.cs
- FlowLayout.cs
- Metafile.cs
- SectionInput.cs
- EdmToObjectNamespaceMap.cs
- MenuItemCollection.cs
- CompressionTransform.cs
- Int32CAMarshaler.cs
- RectangleGeometry.cs
- StaticSiteMapProvider.cs
- CultureSpecificCharacterBufferRange.cs
- TreeWalker.cs
- ThreadExceptionDialog.cs
- TransportationConfigurationTypeInstallComponent.cs
- EntityViewGenerationConstants.cs
- IgnoreFileBuildProvider.cs
- WebPartPersonalization.cs
- PolyQuadraticBezierSegment.cs
- KeyInfo.cs
- XComponentModel.cs
- CodePropertyReferenceExpression.cs
- XmlnsCompatibleWithAttribute.cs
- OperationAbortedException.cs
- NativeMethods.cs
- ConfigXmlWhitespace.cs
- Int64Animation.cs
- DrawingVisualDrawingContext.cs
- DataBoundControlDesigner.cs
- ConditionalDesigner.cs
- DescendantQuery.cs
- Context.cs
- TemplateInstanceAttribute.cs
- ResourceIDHelper.cs
- CombinedGeometry.cs
- TableRow.cs
- GeneralTransform3DCollection.cs
- XmlCharacterData.cs
- SecurityPolicySection.cs
- ItemMap.cs
- TypeListConverter.cs
- SqlWebEventProvider.cs
- SchemaRegistration.cs
- ObjectStateManagerMetadata.cs
- WebPartCancelEventArgs.cs
- TabPanel.cs
- NumericUpDownAcceleration.cs
- TimelineGroup.cs
- ZipIOCentralDirectoryBlock.cs
- CreateUserWizardAutoFormat.cs
- NamespaceImport.cs
- ChangesetResponse.cs
- EncodingNLS.cs
- XmlWrappingReader.cs
- FileDialog_Vista.cs
- PersonalizationProvider.cs
- SchemaMerger.cs
- ExclusiveCanonicalizationTransform.cs
- SiteMapProvider.cs
- NamespaceCollection.cs
- HostingPreferredMapPath.cs
- RewritingValidator.cs
- TagPrefixCollection.cs
- FixedFindEngine.cs
- WorkflowViewService.cs
- SynthesizerStateChangedEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ColorKeyFrameCollection.cs