crypt32: Update definition of CERT_CHAIN_ENGINE_CONFIG.
diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index 1724f42..ec7f602 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -152,6 +152,20 @@
return engine;
}
+typedef struct _CERT_CHAIN_ENGINE_CONFIG_NO_EXCLUSIVE_ROOT
+{
+ DWORD cbSize;
+ HCERTSTORE hRestrictedRoot;
+ HCERTSTORE hRestrictedTrust;
+ HCERTSTORE hRestrictedOther;
+ DWORD cAdditionalStore;
+ HCERTSTORE *rghAdditionalStore;
+ DWORD dwFlags;
+ DWORD dwUrlRetrievalTimeout;
+ DWORD MaximumCachedCertificates;
+ DWORD CycleDetectionModulus;
+} CERT_CHAIN_ENGINE_CONFIG_NO_EXCLUSIVE_ROOT;
+
BOOL WINAPI CertCreateCertificateChainEngine(PCERT_CHAIN_ENGINE_CONFIG pConfig,
HCERTCHAINENGINE *phChainEngine)
{
@@ -159,7 +173,8 @@
TRACE("(%p, %p)\n", pConfig, phChainEngine);
- if (pConfig->cbSize != sizeof(*pConfig))
+ if (pConfig->cbSize != sizeof(CERT_CHAIN_ENGINE_CONFIG_NO_EXCLUSIVE_ROOT)
+ && pConfig->cbSize != sizeof(CERT_CHAIN_ENGINE_CONFIG))
{
SetLastError(E_INVALIDARG);
return FALSE;
diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c
index f9ccaed..6b23361 100644
--- a/dlls/crypt32/tests/chain.c
+++ b/dlls/crypt32/tests/chain.c
@@ -60,11 +60,25 @@
#define IS_INTOID(x) (((ULONG_PTR)(x) >> 16) == 0)
+typedef struct _CERT_CHAIN_ENGINE_CONFIG_NO_EXCLUSIVE_ROOT
+{
+ DWORD cbSize;
+ HCERTSTORE hRestrictedRoot;
+ HCERTSTORE hRestrictedTrust;
+ HCERTSTORE hRestrictedOther;
+ DWORD cAdditionalStore;
+ HCERTSTORE *rghAdditionalStore;
+ DWORD dwFlags;
+ DWORD dwUrlRetrievalTimeout;
+ DWORD MaximumCachedCertificates;
+ DWORD CycleDetectionModulus;
+} CERT_CHAIN_ENGINE_CONFIG_NO_EXCLUSIVE_ROOT;
static void testCreateCertChainEngine(void)
{
BOOL ret;
- CERT_CHAIN_ENGINE_CONFIG config = { 0 };
+ CERT_CHAIN_ENGINE_CONFIG_NO_EXCLUSIVE_ROOT config = { 0 };
+ CERT_CHAIN_ENGINE_CONFIG *pConfig = (CERT_CHAIN_ENGINE_CONFIG *)&config;
HCERTCHAINENGINE engine;
HCERTSTORE store;
@@ -77,21 +91,21 @@
/* Crash
ret = pCertCreateCertificateChainEngine(NULL, NULL);
ret = pCertCreateCertificateChainEngine(NULL, &engine);
- ret = pCertCreateCertificateChainEngine(&config, NULL);
+ ret = pCertCreateCertificateChainEngine(pConfig, NULL);
*/
- ret = pCertCreateCertificateChainEngine(&config, &engine);
+ ret = pCertCreateCertificateChainEngine(pConfig, &engine);
ok(!ret && GetLastError() == E_INVALIDARG,
"Expected E_INVALIDARG, got %08x\n", GetLastError());
/* Crashes
config.cbSize = sizeof(config);
- ret = pCertCreateCertificateChainEngine(&config, NULL);
+ ret = pCertCreateCertificateChainEngine(pConfig, NULL);
*/
config.cbSize = sizeof(config);
- ret = pCertCreateCertificateChainEngine(&config, &engine);
+ ret = pCertCreateCertificateChainEngine(pConfig, &engine);
ok(ret, "CertCreateCertificateChainEngine failed: %08x\n", GetLastError());
pCertFreeCertificateChainEngine(engine);
config.dwFlags = 0xff000000;
- ret = pCertCreateCertificateChainEngine(&config, &engine);
+ ret = pCertCreateCertificateChainEngine(pConfig, &engine);
ok(ret, "CertCreateCertificateChainEngine failed: %08x\n", GetLastError());
pCertFreeCertificateChainEngine(engine);
@@ -99,7 +113,7 @@
store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
config.hRestrictedRoot = store;
- ret = pCertCreateCertificateChainEngine(&config, &engine);
+ ret = pCertCreateCertificateChainEngine(pConfig, &engine);
ok(ret, "CertCreateCertificateChainEngine failed: %08x\n", GetLastError());
pCertFreeCertificateChainEngine(engine);
@@ -108,7 +122,7 @@
*/
CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, selfSignedCert,
sizeof(selfSignedCert), CERT_STORE_ADD_ALWAYS, NULL);
- ret = pCertCreateCertificateChainEngine(&config, &engine);
+ ret = pCertCreateCertificateChainEngine(pConfig, &engine);
ok(!ret && GetLastError() == CRYPT_E_NOT_FOUND,
"Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError());
diff --git a/include/wincrypt.h b/include/wincrypt.h
index e536213..d3f56b9 100644
--- a/include/wincrypt.h
+++ b/include/wincrypt.h
@@ -3389,6 +3389,8 @@
DWORD dwUrlRetrievalTimeout;
DWORD MaximumCachedCertificates;
DWORD CycleDetectionModulus;
+ HCERTSTORE hExclusiveRoot;
+ HCERTSTORE hExclusiveRootTrustedPeople;
} CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
/* message-related definitions */