From ea4489cfb06fff2985c07e3ed11a68f5ae90dff5 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Mon, 11 Feb 2008 14:25:20 +0100 Subject: [PATCH] wintrust/crypt: Fix some test failures for a NULL parameter. --- dlls/wintrust/crypt.c | 9 ++++++++- dlls/wintrust/tests/crypt.c | 6 ------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index c919eef3c6a..8819ea8bb20 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -51,7 +51,14 @@ BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin, { FIXME("%p %s %x\n", catAdmin, debugstr_guid(sysSystem), dwFlags); - if (catAdmin) *catAdmin = (HCATADMIN)0xdeadbeef; + if (!catAdmin) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + *catAdmin = (HCATADMIN)0xdeadbeef; + return TRUE; } diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c index 887d57a7af5..31d8b8ba5ac 100644 --- a/dlls/wintrust/tests/crypt.c +++ b/dlls/wintrust/tests/crypt.c @@ -67,12 +67,9 @@ static void test_context(void) /* All NULL */ SetLastError(0xdeadbeef); ret = pCryptCATAdminAcquireContext(NULL, NULL, 0); - todo_wine - { ok(!ret, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - } /* NULL GUID */ SetLastError(0xdeadbeef); @@ -113,12 +110,9 @@ static void test_context(void) /* NULL context handle and dummy GUID */ SetLastError(0xdeadbeef); ret = pCryptCATAdminAcquireContext(NULL, &dummy, 0); - todo_wine - { ok(!ret, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - } /* Correct context handle and dummy GUID */ SetLastError(0xdeadbeef);