Changes due to continued development effort.

This commit is contained in:
Juan Carlos Luciani
2006-04-28 18:59:15 +00:00
parent fe756d9f5e
commit 3f76e165ad
4 changed files with 146 additions and 59 deletions

View File

@@ -44,7 +44,10 @@
//===[ Global variables ]==================================================
// In memory auth cache list head
LIST_ENTRY authCacheListHead;
LIST_ENTRY g_authCacheListHead;
// Non-host specific key name
char g_allHosts[] = "AllHosts";
//++=======================================================================
@@ -61,13 +64,19 @@ CreateAuthCacheEntry(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
AuthCacheEntry *pEntry;
DbgTrace(1, "-CreateAuthCacheEntry- Start\n", 0);
// Use allHosts if a host name was not specified
if (pHostName == NULL)
{
pHostName = g_allHosts;
}
// Allocate space for the entry
pEntry = (AuthCacheEntry*) malloc(sizeof(*pEntry));
if (pEntry)
@@ -133,7 +142,7 @@ FreeAuthCacheEntry(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
DbgTrace(1, "-FreeAuthCacheEntry- Start\n", 0);
@@ -170,7 +179,7 @@ CacheEntryLifetimeExpired(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
DWORD currentTime = GetTickCount();
@@ -237,7 +246,7 @@ FindEntryInAuthCache(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
AuthCacheEntry *pEntry = NULL;
@@ -248,9 +257,15 @@ FindEntryInAuthCache(
// Examine the cache, if entry found then check if it has expired
// in which case we would want to remove it from the cache.
// Use allHosts if a host name was not specified
if (pHostName == NULL)
{
pHostName = g_allHosts;
}
// First look through the entries in our in-memory cache
pListEntry = authCacheListHead.Flink;
while (pListEntry != &authCacheListHead)
pListEntry = g_authCacheListHead.Flink;
while (pListEntry != &g_authCacheListHead)
{
AuthCacheEntry *pWrkEntry;
@@ -410,7 +425,7 @@ FindEntryInAuthCache(
// add it to the in-memory cache.
entryInitialized = TRUE;
deleteCacheKeyNameKey = FALSE;
InsertHeadList(&authCacheListHead, &pEntry->listEntry);
InsertHeadList(&g_authCacheListHead, &pEntry->listEntry);
}
else
{
@@ -435,7 +450,7 @@ FindEntryInAuthCache(
// add it to the in-memory cache.
entryInitialized = TRUE;
deleteCacheKeyNameKey = FALSE;
InsertHeadList(&authCacheListHead, &pEntry->listEntry);
InsertHeadList(&g_authCacheListHead, &pEntry->listEntry);
}
}
else
@@ -509,7 +524,7 @@ AddEntryToAuthCache(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
LONG status;
@@ -653,7 +668,7 @@ AddEntryToAuthCache(
{
// The entry was added to the cache, save it in
// our in-memory cache.
InsertHeadList(&authCacheListHead, &pEntry->listEntry);
InsertHeadList(&g_authCacheListHead, &pEntry->listEntry);
}
else
{
@@ -678,7 +693,7 @@ InitializeAuthCache(void)
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
CasaStatus retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
@@ -690,7 +705,7 @@ InitializeAuthCache(void)
DbgTrace(1, "-InitializeAuthCache- Start\n", 0);
// Initialize the cache list head
InitializeListHead(&authCacheListHead);
InitializeListHead(&g_authCacheListHead);
// Lets create the CASA Auth Cache registry key in the
// user's hive and limit access to it.
@@ -873,3 +888,8 @@ InitializeAuthCache(void)
return retStatus;
}
//++=======================================================================
//++=======================================================================
//++=======================================================================