From fa37b63517563460a10ac863ac9526106b939bc4 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 17 Oct 2013 11:10:18 +0200 Subject: [PATCH] crypt32: Moved ContextList freeing to store.c and get rid of ContextList. --- dlls/crypt32/context.c | 12 ------------ dlls/crypt32/crypt32_private.h | 7 ------- dlls/crypt32/store.c | 18 +++++++++++++++--- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/dlls/crypt32/context.c b/dlls/crypt32/context.c index 82b1021da62..4809eeaa57f 100644 --- a/dlls/crypt32/context.c +++ b/dlls/crypt32/context.c @@ -109,15 +109,3 @@ void Context_CopyProperties(const void *to, const void *from) assert(toProperties && fromProperties); ContextPropertyList_Copy(toProperties, fromProperties); } - -void ContextList_Free(ContextList *list) -{ - context_t *context, *next; - - LIST_FOR_EACH_ENTRY_SAFE(context, next, list, context_t, u.entry) - { - TRACE("removing %p\n", context); - list_remove(&context->u.entry); - Context_Release(context); - } -} diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index dc66ebfda44..dbb9ee51731 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -433,13 +433,6 @@ void ContextPropertyList_Copy(CONTEXT_PROPERTY_LIST *to, void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN; -/** - * Context list functions. A context list is a simple list of link contexts. - */ -typedef struct list ContextList; - -void ContextList_Free(ContextList *list) DECLSPEC_HIDDEN; - extern WINECRYPT_CERTSTORE empty_store; void init_empty_store(void) DECLSPEC_HIDDEN; diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index 76ba9449431..07613ec5404 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -215,6 +215,18 @@ static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context) return TRUE; } +static void free_contexts(struct list *list) +{ + context_t *context, *next; + + LIST_FOR_EACH_ENTRY_SAFE(context, next, list, context_t, u.entry) + { + TRACE("freeing %p\n", context); + list_remove(&context->u.entry); + Context_Release(context); + } +} + static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert, context_t *toReplace, context_t **ppStoreContext, BOOL use_link) { @@ -317,9 +329,9 @@ static DWORD MemStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags) if(ref) return (flags & CERT_CLOSE_STORE_CHECK_FLAG) ? CRYPT_E_PENDING_CLOSE : ERROR_SUCCESS; - ContextList_Free(&store->certs); - ContextList_Free(&store->crls); - ContextList_Free(&store->ctls); + free_contexts(&store->certs); + free_contexts(&store->crls); + free_contexts(&store->ctls); store->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&store->cs); CRYPT_FreeStore(&store->hdr);