Juan Lang : crypt32: Implement CertStoreControl for collection stores.

Alexandre Julliard julliard at winehq.org
Wed Nov 4 10:26:26 CST 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Nov  3 11:02:03 2009 -0800

crypt32: Implement CertStoreControl for collection stores.

---

 dlls/crypt32/collectionstore.c |   40 ++++++++++++++++++++++++++++++++++++++++
 dlls/crypt32/tests/store.c     |    1 -
 2 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/dlls/crypt32/collectionstore.c b/dlls/crypt32/collectionstore.c
index e55c1bf..35941dd 100644
--- a/dlls/crypt32/collectionstore.c
+++ b/dlls/crypt32/collectionstore.c
@@ -441,6 +441,45 @@ static BOOL CRYPT_CollectionDeleteCTL(PWINECRYPT_CERTSTORE store,
     return ret;
 }
 
+static BOOL WINAPI CRYPT_CollectionControl(HCERTSTORE hCertStore, DWORD dwFlags,
+ DWORD dwCtrlType, void const *pvCtrlPara)
+{
+    BOOL ret;
+    PWINE_COLLECTIONSTORE store = hCertStore;
+    PWINE_STORE_LIST_ENTRY entry;
+
+    TRACE("(%p, %08x, %d, %p)\n", hCertStore, dwFlags, dwCtrlType,
+     pvCtrlPara);
+
+    if (!store)
+        return TRUE;
+    if (store->hdr.dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
+    {
+        SetLastError(E_INVALIDARG);
+        return FALSE;
+    }
+    if (store->hdr.type != StoreTypeCollection)
+    {
+        SetLastError(E_INVALIDARG);
+        return FALSE;
+    }
+
+    ret = TRUE;
+    EnterCriticalSection(&store->cs);
+    LIST_FOR_EACH_ENTRY(entry, &store->stores, WINE_STORE_LIST_ENTRY, entry)
+    {
+        if (entry->store->control)
+        {
+            ret = entry->store->control(entry->store, dwFlags, dwCtrlType,
+             pvCtrlPara);
+            if (!ret)
+                break;
+        }
+    }
+    LeaveCriticalSection(&store->cs);
+    return ret;
+}
+
 PWINECRYPT_CERTSTORE CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv,
  DWORD dwFlags, const void *pvPara)
 {
@@ -468,6 +507,7 @@ PWINECRYPT_CERTSTORE CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv,
             store->hdr.ctls.addContext     = CRYPT_CollectionAddCTL;
             store->hdr.ctls.enumContext    = CRYPT_CollectionEnumCTL;
             store->hdr.ctls.deleteContext  = CRYPT_CollectionDeleteCTL;
+            store->hdr.control             = CRYPT_CollectionControl;
             InitializeCriticalSection(&store->cs);
             store->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PWINE_COLLECTIONSTORE->cs");
             list_init(&store->stores);
diff --git a/dlls/crypt32/tests/store.c b/dlls/crypt32/tests/store.c
index ff39d71..ee91e73 100644
--- a/dlls/crypt32/tests/store.c
+++ b/dlls/crypt32/tests/store.c
@@ -658,7 +658,6 @@ static void testCollectionStore(void)
     pCertAddStoreToCollection(collection, store1, 0, 0);
     SetLastError(0xdeadbeef);
     ret = pCertControlStore(collection, 0, CERT_STORE_CTRL_COMMIT, NULL);
-    todo_wine
     ok(!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED,
      "expected ERROR_CALL_NOT_IMPLEMENTED, got %d\n", GetLastError());
     pCertRemoveStoreFromCollection(collection, store1);




More information about the wine-cvs mailing list