Jacek Caban : crypt32: Use Context_Release instead of WINE_CONTEXT_INTERFACE.

Alexandre Julliard julliard at winehq.org
Mon Oct 14 12:39:29 CDT 2013


Module: wine
Branch: master
Commit: c72570ce52dcb78668c291c0bd35f387e79766e2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c72570ce52dcb78668c291c0bd35f387e79766e2

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Oct 14 14:47:50 2013 +0200

crypt32: Use Context_Release instead of WINE_CONTEXT_INTERFACE.

---

 dlls/crypt32/collectionstore.c |    2 +-
 dlls/crypt32/context.c         |    6 +++---
 dlls/crypt32/crypt32_private.h |    2 --
 dlls/crypt32/object.c          |    2 +-
 dlls/crypt32/regstore.c        |    4 ++--
 dlls/crypt32/serialize.c       |   10 +++++-----
 dlls/crypt32/store.c           |    3 ---
 7 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/dlls/crypt32/collectionstore.c b/dlls/crypt32/collectionstore.c
index 7f494c5..af209cd 100644
--- a/dlls/crypt32/collectionstore.c
+++ b/dlls/crypt32/collectionstore.c
@@ -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
diff --git a/dlls/crypt32/context.c b/dlls/crypt32/context.c
index 7f6f00d..ff1c440 100644
--- a/dlls/crypt32/context.c
+++ b/dlls/crypt32/context.c
@@ -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);
 }
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index 08f5563..bcb4808 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -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;
 
diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c
index 074bdd8..0ff1bfd 100644
--- a/dlls/crypt32/object.c
+++ b/dlls/crypt32/object.c
@@ -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);
diff --git a/dlls/crypt32/regstore.c b/dlls/crypt32/regstore.c
index a5d69a1..8fb7eeb 100644
--- a/dlls/crypt32/regstore.c
+++ b/dlls/crypt32/regstore.c
@@ -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;
 }
 
diff --git a/dlls/crypt32/serialize.c b/dlls/crypt32/serialize.c
index d8027c1..e8ccc4a 100644
--- a/dlls/crypt32/serialize.c
+++ b/dlls/crypt32/serialize.c
@@ -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;
diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index e3c6cfd..f11279c 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -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;




More information about the wine-cvs mailing list