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
- TextFragmentEngine.cs
- EncoderBestFitFallback.cs
- HttpWebResponse.cs
- CheckBoxBaseAdapter.cs
- TextModifier.cs
- SqlComparer.cs
- DelegateHelpers.Generated.cs
- EncodingDataItem.cs
- DataServiceClientException.cs
- XmlnsDictionary.cs
- InfoCardX509Validator.cs
- System.Data.OracleClient_BID.cs
- DeflateEmulationStream.cs
- DropDownList.cs
- XmlAttribute.cs
- SymbolMethod.cs
- DesignUtil.cs
- ConnectionStringsExpressionBuilder.cs
- ViewStateModeByIdAttribute.cs
- RoutedUICommand.cs
- DateTimeConstantAttribute.cs
- SmtpTransport.cs
- ExtentCqlBlock.cs
- AssemblyAttributesGoHere.cs
- PartBasedPackageProperties.cs
- XmlWrappingWriter.cs
- SqlGatherConsumedAliases.cs
- ProcessRequestArgs.cs
- BoolExpressionVisitors.cs
- EventProviderTraceListener.cs
- XmlCharCheckingReader.cs
- ChannelServices.cs
- WindowsHyperlink.cs
- AnnotationResource.cs
- ChangeProcessor.cs
- Comparer.cs
- StylusShape.cs
- RectangleF.cs
- DesignTimeVisibleAttribute.cs
- LicenseManager.cs
- EdmSchemaError.cs
- EventTrigger.cs
- RotateTransform3D.cs
- XmlStringTable.cs
- SystemWebSectionGroup.cs
- LogEntrySerializer.cs
- TypeDescriptor.cs
- WebServiceHostFactory.cs
- PathGeometry.cs
- ZipIOExtraField.cs
- Columns.cs
- BasicDesignerLoader.cs
- TextOutput.cs
- MimeWriter.cs
- XmlCharCheckingReader.cs
- JapaneseLunisolarCalendar.cs
- SchemaImporterExtension.cs
- MemoryPressure.cs
- NavigationFailedEventArgs.cs
- recordstate.cs
- WebSysDescriptionAttribute.cs
- XmlSchemaObject.cs
- XmlSchemaAppInfo.cs
- DispatcherBuilder.cs
- cookieexception.cs
- XmlComplianceUtil.cs
- SeekableReadStream.cs
- DPCustomTypeDescriptor.cs
- DataStreamFromComStream.cs
- SurrogateDataContract.cs
- ByteStreamGeometryContext.cs
- PointAnimationUsingKeyFrames.cs
- DataGridClipboardCellContent.cs
- BinaryWriter.cs
- AttachedPropertyMethodSelector.cs
- EncodingTable.cs
- OneOfTypeConst.cs
- WsdlBuildProvider.cs
- Rectangle.cs
- PropertyTabChangedEvent.cs
- IISUnsafeMethods.cs
- SqlNodeTypeOperators.cs
- Translator.cs
- AuthenticationSection.cs
- UnsafeNativeMethods.cs
- AlphabeticalEnumConverter.cs
- CounterSampleCalculator.cs
- ActivityTypeResolver.xaml.cs
- JoinCqlBlock.cs
- ListViewGroupItemCollection.cs
- FeatureSupport.cs
- SmtpMail.cs
- CatalogZone.cs
- TemplateBindingExpression.cs
- LookupBindingPropertiesAttribute.cs
- Menu.cs
- AvTraceDetails.cs
- NotCondition.cs
- SmuggledIUnknown.cs
- LinkGrep.cs