crypt32: Use Context_Release instead of WINE_CONTEXT_INTERFACE.
This commit is contained in:
parent
76066d1cfe
commit
c72570ce52
|
@ -163,7 +163,7 @@ static void *CRYPT_CollectionAdvanceEnum(WINE_COLLECTIONSTORE *store,
|
|||
child = Context_GetLinkedContext(pPrev);
|
||||
Context_AddRef(context_from_ptr(child));
|
||||
child = contextFuncs->enumContext(storeEntry->store, child);
|
||||
contextInterface->free(pPrev);
|
||||
Context_Release(context_from_ptr(pPrev));
|
||||
pPrev = NULL;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -206,7 +206,7 @@ void *ContextList_Add(struct ContextList *list, void *toLink, void *toReplace)
|
|||
entry->prev->next = entry;
|
||||
entry->next->prev = entry;
|
||||
existing->prev = existing->next = existing;
|
||||
list->contextInterface->free(toReplace);
|
||||
Context_Release(context_from_ptr(toReplace));
|
||||
}
|
||||
else
|
||||
list_add_head(&list->contexts, entry);
|
||||
|
@ -226,7 +226,7 @@ void *ContextList_Enum(struct ContextList *list, void *pPrev)
|
|||
struct list *prevEntry = ContextList_ContextToEntry(list, pPrev);
|
||||
|
||||
listNext = list_next(&list->contexts, prevEntry);
|
||||
list->contextInterface->free(pPrev);
|
||||
Context_Release(context_from_ptr(pPrev));
|
||||
}
|
||||
else
|
||||
listNext = list_next(&list->contexts, &list->contexts);
|
||||
|
@ -270,7 +270,7 @@ static void ContextList_Empty(struct ContextList *list)
|
|||
|
||||
TRACE("removing %p\n", context);
|
||||
list_remove(entry);
|
||||
list->contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
}
|
||||
LeaveCriticalSection(&list->cs);
|
||||
}
|
||||
|
|
|
@ -226,7 +226,6 @@ typedef BOOL (WINAPI *SetContextPropertyFunc)(const void *context,
|
|||
DWORD dwPropID, DWORD dwFlags, const void *pvData);
|
||||
typedef BOOL (WINAPI *SerializeElementFunc)(const void *context, DWORD dwFlags,
|
||||
BYTE *pbElement, DWORD *pcbElement);
|
||||
typedef BOOL (WINAPI *FreeContextFunc)(const void *context);
|
||||
typedef BOOL (WINAPI *DeleteContextFunc)(const void *contex);
|
||||
|
||||
/* An abstract context (certificate, CRL, or CTL) interface */
|
||||
|
@ -240,7 +239,6 @@ typedef struct _WINE_CONTEXT_INTERFACE
|
|||
GetContextPropertyFunc getProp;
|
||||
SetContextPropertyFunc setProp;
|
||||
SerializeElementFunc serialize;
|
||||
FreeContextFunc free;
|
||||
DeleteContextFunc deleteFromStore;
|
||||
} WINE_CONTEXT_INTERFACE;
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ static BOOL CRYPT_QuerySerializedContextObject(DWORD dwObjectType,
|
|||
|
||||
end:
|
||||
if (contextInterface && context)
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
if (blob == &fileBlob)
|
||||
CryptMemFree(blob->pbData);
|
||||
TRACE("returning %d\n", ret);
|
||||
|
|
|
@ -143,7 +143,7 @@ static void CRYPT_RegReadSerializedFromReg(HKEY key, DWORD contextType,
|
|||
else
|
||||
TRACE("hash doesn't match, ignoring\n");
|
||||
}
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ static BOOL CRYPT_SerializeContextsToReg(HKEY key,
|
|||
ret = TRUE;
|
||||
} while (ret && context != NULL);
|
||||
if (context)
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -409,7 +409,7 @@ const void *CRYPT_ReadSerializedElement(const BYTE *pbElement, DWORD cbElement,
|
|||
}
|
||||
else
|
||||
{
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
context = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ static BOOL CRYPT_ReadSerializedStore(void *handle,
|
|||
propHdr.propID == CERT_CTL_PROP_ID))
|
||||
{
|
||||
/* We have a new context, so free the existing one */
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
}
|
||||
if (propHdr.cb > bufSize)
|
||||
{
|
||||
|
@ -522,7 +522,7 @@ static BOOL CRYPT_ReadSerializedStore(void *handle,
|
|||
if (contextInterface && context)
|
||||
{
|
||||
/* Free the last context added */
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
}
|
||||
CryptMemFree(buf);
|
||||
ret = TRUE;
|
||||
|
@ -638,7 +638,7 @@ static BOOL CRYPT_SerializeContextsToStream(SerializedOutputFunc output,
|
|||
ret = TRUE;
|
||||
} while (ret && context != NULL);
|
||||
if (context)
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -996,7 +996,7 @@ BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore,
|
|||
*pdwContentType = type;
|
||||
ret = contextInterface->addContextToStore(hCertStore, context,
|
||||
dwAddDisposition, ppvContext);
|
||||
contextInterface->free(context);
|
||||
Context_Release(context_from_ptr(context));
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
|
|
|
@ -50,7 +50,6 @@ static const WINE_CONTEXT_INTERFACE gCertInterface = {
|
|||
(GetContextPropertyFunc)CertGetCertificateContextProperty,
|
||||
(SetContextPropertyFunc)CertSetCertificateContextProperty,
|
||||
(SerializeElementFunc)CertSerializeCertificateStoreElement,
|
||||
(FreeContextFunc)CertFreeCertificateContext,
|
||||
(DeleteContextFunc)CertDeleteCertificateFromStore,
|
||||
};
|
||||
const WINE_CONTEXT_INTERFACE *pCertInterface = &gCertInterface;
|
||||
|
@ -64,7 +63,6 @@ static const WINE_CONTEXT_INTERFACE gCRLInterface = {
|
|||
(GetContextPropertyFunc)CertGetCRLContextProperty,
|
||||
(SetContextPropertyFunc)CertSetCRLContextProperty,
|
||||
(SerializeElementFunc)CertSerializeCRLStoreElement,
|
||||
(FreeContextFunc)CertFreeCRLContext,
|
||||
(DeleteContextFunc)CertDeleteCRLFromStore,
|
||||
};
|
||||
const WINE_CONTEXT_INTERFACE *pCRLInterface = &gCRLInterface;
|
||||
|
@ -78,7 +76,6 @@ static const WINE_CONTEXT_INTERFACE gCTLInterface = {
|
|||
(GetContextPropertyFunc)CertGetCTLContextProperty,
|
||||
(SetContextPropertyFunc)CertSetCTLContextProperty,
|
||||
(SerializeElementFunc)CertSerializeCTLStoreElement,
|
||||
(FreeContextFunc)CertFreeCTLContext,
|
||||
(DeleteContextFunc)CertDeleteCTLFromStore,
|
||||
};
|
||||
const WINE_CONTEXT_INTERFACE *pCTLInterface = &gCTLInterface;
|
||||
|
|
Loading…
Reference in New Issue