|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
crypt32(3/3): Implement CertStoreControl for collection stores--Juan
[0022-Implement-CertStoreControl-for-collection-stores.patch] From 5e00a2652cb35d644f42750e5937de9a4454a50f Mon Sep 17 00:00:00 2001 From: Juan Lang <juan.lang@...> Date: Tue, 3 Nov 2009 11:02:03 -0800 Subject: [PATCH] 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 9a48e6c..3e8a651 100644 --- a/dlls/crypt32/collectionstore.c +++ b/dlls/crypt32/collectionstore.c @@ -440,6 +440,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) { @@ -467,6 +506,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 3f3543d..30008c0 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); -- 1.6.0.6 |
| Free embeddable forum powered by Nabble | Forum Help |