crypt32: Get rid of no longer needed Context_GetLinkedContext.

This commit is contained in:
Jacek Caban 2013-10-15 16:54:05 +02:00 committed by Alexandre Julliard
parent 6ab429363a
commit 4553e6d144
2 changed files with 23 additions and 23 deletions

View File

@ -98,14 +98,14 @@ static BOOL CRYPT_CollectionAddContext(WINE_COLLECTIONSTORE *store,
ret = FALSE; ret = FALSE;
if (toReplace) if (toReplace)
{ {
void *existingLinked = Context_GetLinkedContext(toReplace); context_t *existingLinked = context_from_ptr(toReplace)->linked;
CONTEXT_FUNCS *contextFuncs; CONTEXT_FUNCS *contextFuncs;
storeEntry = context_from_ptr(toReplace)->u.ptr; storeEntry = context_from_ptr(toReplace)->u.ptr;
contextFuncs = (CONTEXT_FUNCS*)((LPBYTE)storeEntry->store->vtbl + contextFuncs = (CONTEXT_FUNCS*)((LPBYTE)storeEntry->store->vtbl +
contextFuncsOffset); contextFuncsOffset);
ret = contextFuncs->addContext(storeEntry->store, context, ret = contextFuncs->addContext(storeEntry->store, context,
existingLinked, (const void **)&childContext); context_ptr(existingLinked), (const void **)&childContext);
} }
else else
{ {
@ -147,7 +147,8 @@ static void *CRYPT_CollectionAdvanceEnum(WINE_COLLECTIONSTORE *store,
WINE_STORE_LIST_ENTRY *storeEntry, const CONTEXT_FUNCS *contextFuncs, WINE_STORE_LIST_ENTRY *storeEntry, const CONTEXT_FUNCS *contextFuncs,
const WINE_CONTEXT_INTERFACE *contextInterface, void *pPrev, size_t contextSize) const WINE_CONTEXT_INTERFACE *contextInterface, void *pPrev, size_t contextSize)
{ {
void *ret, *child; context_t *child;
void *ret, *tmp;
struct list *storeNext = list_next(&store->stores, &storeEntry->entry); struct list *storeNext = list_next(&store->stores, &storeEntry->entry);
TRACE("(%p, %p, %p)\n", store, storeEntry, pPrev); TRACE("(%p, %p, %p)\n", store, storeEntry, pPrev);
@ -157,17 +158,21 @@ static void *CRYPT_CollectionAdvanceEnum(WINE_COLLECTIONSTORE *store,
/* Ref-counting funny business: "duplicate" (addref) the child, because /* Ref-counting funny business: "duplicate" (addref) the child, because
* the free(pPrev) below can cause the ref count to become negative. * the free(pPrev) below can cause the ref count to become negative.
*/ */
child = Context_GetLinkedContext(pPrev); child = context_from_ptr(pPrev)->linked;
Context_AddRef(context_from_ptr(child)); Context_AddRef(child);
child = contextFuncs->enumContext(storeEntry->store, child); tmp = contextFuncs->enumContext(storeEntry->store, context_ptr(child));
child = tmp ? context_from_ptr(tmp) : NULL;
Context_Release(context_from_ptr(pPrev)); Context_Release(context_from_ptr(pPrev));
pPrev = NULL; pPrev = NULL;
} }
else else
child = contextFuncs->enumContext(storeEntry->store, NULL); {
tmp = contextFuncs->enumContext(storeEntry->store, NULL);
child = tmp ? context_from_ptr(tmp) : NULL;
}
if (child) { if (child) {
ret = CRYPT_CollectionCreateContextFromChild(store, storeEntry, context_from_ptr(child), contextSize); ret = CRYPT_CollectionCreateContextFromChild(store, storeEntry, child, contextSize);
Context_Release(context_from_ptr(child)); Context_Release(child);
} }
else else
{ {
@ -259,13 +264,13 @@ static void *Collection_enumCert(WINECRYPT_CERTSTORE *store, void *pPrev)
static BOOL Collection_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context) static BOOL Collection_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context)
{ {
cert_t *cert = (cert_t*)context; cert_t *cert = (cert_t*)context;
cert_t *linked;
BOOL ret; BOOL ret;
PCCERT_CONTEXT linked;
TRACE("(%p, %p)\n", store, cert); TRACE("(%p, %p)\n", store, cert);
linked = Context_GetLinkedContext(&cert->ctx); linked = (cert_t*)context->linked;
ret = CertDeleteCertificateFromStore(linked); ret = CertDeleteCertificateFromStore(&linked->ctx);
Context_Release(&cert->base); Context_Release(&cert->base);
return ret; return ret;
} }
@ -332,14 +337,13 @@ static void *Collection_enumCRL(WINECRYPT_CERTSTORE *store, void *pPrev)
static BOOL Collection_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *context) static BOOL Collection_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *context)
{ {
crl_t *crl = (crl_t*)context; crl_t *crl = (crl_t*)context, *linked;
BOOL ret; BOOL ret;
PCCRL_CONTEXT linked;
TRACE("(%p, %p)\n", store, crl); TRACE("(%p, %p)\n", store, crl);
linked = Context_GetLinkedContext(&crl->ctx); linked = (crl_t*)context->linked;
ret = CertDeleteCRLFromStore(linked); ret = CertDeleteCRLFromStore(&linked->ctx);
Context_Release(&crl->base); Context_Release(&crl->base);
return ret; return ret;
} }
@ -406,14 +410,13 @@ static void *Collection_enumCTL(WINECRYPT_CERTSTORE *store, void *pPrev)
static BOOL Collection_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *context) static BOOL Collection_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *context)
{ {
ctl_t *ctl = (ctl_t*)context; ctl_t *ctl = (ctl_t*)context, *linked;
BOOL ret; BOOL ret;
PCCTL_CONTEXT linked;
TRACE("(%p, %p)\n", store, ctl); TRACE("(%p, %p)\n", store, ctl);
linked = Context_GetLinkedContext(&ctl->ctx); linked = (ctl_t*)context->linked;
ret = CertDeleteCTLFromStore(linked); ret = CertDeleteCTLFromStore(&linked->ctx);
Context_Release(&ctl->base); Context_Release(&ctl->base);
return ret; return ret;
} }

View File

@ -402,9 +402,6 @@ void *Context_CreateDataContext(size_t contextSize, const context_vtbl_t *vtbl)
*/ */
context_t *Context_CreateLinkContext(unsigned contextSize, context_t *linked) DECLSPEC_HIDDEN; context_t *Context_CreateLinkContext(unsigned contextSize, context_t *linked) DECLSPEC_HIDDEN;
/* Gets the context linked to by context, which must be a link context. */
void *Context_GetLinkedContext(void*) DECLSPEC_HIDDEN;
/* Copies properties from fromContext to toContext. */ /* Copies properties from fromContext to toContext. */
void Context_CopyProperties(const void *to, const void *from) DECLSPEC_HIDDEN; void Context_CopyProperties(const void *to, const void *from) DECLSPEC_HIDDEN;