crypt32: Fix a test failure on Vista, and make Wine match the newer (and saner) behavior.
This commit is contained in:
parent
79c39e379f
commit
348261e6ab
|
@ -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?)
|
||||
|
|
Loading…
Reference in New Issue