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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GroupBoxAutomationPeer.cs
- XmlReflectionImporter.cs
- UserControlFileEditor.cs
- MergeFilterQuery.cs
- BindingUtils.cs
- SecurityResources.cs
- XDRSchema.cs
- ConstNode.cs
- DataSourceSelectArguments.cs
- TemplateInstanceAttribute.cs
- ToolStripContainerActionList.cs
- XmlElementAttribute.cs
- MdiWindowListItemConverter.cs
- DataServiceQueryOfT.cs
- _LoggingObject.cs
- FieldAccessException.cs
- CodeNamespace.cs
- QueryMatcher.cs
- Effect.cs
- TargetInvocationException.cs
- Emitter.cs
- TypedAsyncResult.cs
- EntityDataSourceEntityTypeFilterItem.cs
- PartBasedPackageProperties.cs
- DocumentEventArgs.cs
- ListViewItem.cs
- GeneralTransformGroup.cs
- MessageBox.cs
- ValidateNames.cs
- MetadataSerializer.cs
- DbParameterCollectionHelper.cs
- ScriptResourceHandler.cs
- DesignerTransactionCloseEvent.cs
- ErrorHandler.cs
- WebColorConverter.cs
- Claim.cs
- XsltLibrary.cs
- UserPersonalizationStateInfo.cs
- AvTraceFormat.cs
- MachinePropertyVariants.cs
- WindowsGraphics2.cs
- Point.cs
- MissingManifestResourceException.cs
- Enum.cs
- MSAANativeProvider.cs
- PageSetupDialog.cs
- MethodBody.cs
- StringResourceManager.cs
- ResourceDefaultValueAttribute.cs
- EditorServiceContext.cs
- ComPlusServiceLoader.cs
- TimeStampChecker.cs
- GiveFeedbackEvent.cs
- PrintEvent.cs
- TextTreeInsertElementUndoUnit.cs
- RewritingSimplifier.cs
- DisposableCollectionWrapper.cs
- XmlSerializationGeneratedCode.cs
- UriSchemeKeyedCollection.cs
- WinInetCache.cs
- EntityDataSourceStatementEditorForm.cs
- DbParameterHelper.cs
- OrthographicCamera.cs
- SerializerDescriptor.cs
- CollectionViewGroupInternal.cs
- QueryCacheManager.cs
- LineVisual.cs
- XhtmlBasicPanelAdapter.cs
- RemoteHelper.cs
- MailHeaderInfo.cs
- BookmarkEventArgs.cs
- TraceProvider.cs
- OutOfMemoryException.cs
- PageBreakRecord.cs
- HttpCookie.cs
- SafePEFileHandle.cs
- IDQuery.cs
- GuidTagList.cs
- HierarchicalDataSourceIDConverter.cs
- HashMembershipCondition.cs
- ThreadStartException.cs
- HostingPreferredMapPath.cs
- Size3DValueSerializer.cs
- DocumentPageViewAutomationPeer.cs
- ConnectionPoint.cs
- Point3DAnimationUsingKeyFrames.cs
- OdbcDataReader.cs
- Inline.cs
- DbgCompiler.cs
- Subtract.cs
- ListViewItemMouseHoverEvent.cs
- WebHeaderCollection.cs
- MergeFilterQuery.cs
- DetailsViewModeEventArgs.cs
- HttpContext.cs
- ValueType.cs
- RawStylusInputCustomData.cs
- ControlIdConverter.cs
- CodeCommentStatementCollection.cs
- SafeNativeMethods.cs