Commit 348261e6 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Fix a test failure on Vista, and make Wine match the newer (and saner) behavior.

parent 79c39e37
......@@ -782,12 +782,6 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
TRACE("(%p, %p, %08x, %p)\n", hCertStore, pCertContext,
dwAddDisposition, ppStoreContext);
/* Weird case to pass a test */
if (dwAddDisposition == 0)
{
SetLastError(STATUS_ACCESS_VIOLATION);
return FALSE;
}
if (dwAddDisposition != CERT_STORE_ADD_ALWAYS)
{
BYTE hashToAdd[20];
......@@ -855,6 +849,7 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
break;
default:
FIXME("Unimplemented add disposition %d\n", dwAddDisposition);
SetLastError(E_INVALIDARG);
ret = FALSE;
}
......
......@@ -160,12 +160,16 @@ static void testAddCert(void)
*/
ret = CertAddEncodedCertificateToStore(0, X509_ASN_ENCODING, bigCert,
sizeof(bigCert), 0, NULL);
ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION,
"Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
ok(!ret && (GetLastError() == STATUS_ACCESS_VIOLATION ||
GetLastError() == E_INVALIDARG),
"Expected STATUS_ACCESS_VIOLATION or E_INVALIDARG, got %08x\n",
GetLastError());
ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING,
bigCert, sizeof(bigCert), 0, NULL);
ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION,
"Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
ok(!ret && (GetLastError() == STATUS_ACCESS_VIOLATION ||
GetLastError() == E_INVALIDARG),
"Expected STATUS_ACCESS_VIOLATION or E_INVALIDARG, got %08x\n",
GetLastError());
/* Weird--can add a cert to the NULL store (does this have special
* meaning?)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment