From 48a3b683e132fc726b12d0668efb46a7a6b9fe80 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 14 Feb 2008 10:33:09 -0800 Subject: [PATCH] Fix a test failure on Vista, and make Wine match the newer (and saner) behavior --- dlls/crypt32/store.c | 7 +------ dlls/crypt32/tests/cert.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index 37247a5..20d71b7 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -782,12 +782,6 @@ BOOL WINAPI CertAddCertificateContextToS 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 CertAddCertificateContextToS break; default: FIXME("Unimplemented add disposition %d\n", dwAddDisposition); + SetLastError(E_INVALIDARG); ret = FALSE; } diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index a31632b..5aa20ae 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -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?) -- 1.4.1