wintrust/crypt: Fix some test failures for a NULL parameter.

This commit is contained in:
Paul Vriens 2008-02-11 14:25:20 +01:00 committed by Alexandre Julliard
parent 517168b4c5
commit ea4489cfb0
2 changed files with 8 additions and 7 deletions

View File

@ -51,7 +51,14 @@ BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin,
{ {
FIXME("%p %s %x\n", catAdmin, debugstr_guid(sysSystem), dwFlags); 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; return TRUE;
} }

View File

@ -67,12 +67,9 @@ static void test_context(void)
/* All NULL */ /* All NULL */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptCATAdminAcquireContext(NULL, NULL, 0); ret = pCryptCATAdminAcquireContext(NULL, NULL, 0);
todo_wine
{
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
/* NULL GUID */ /* NULL GUID */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -113,12 +110,9 @@ static void test_context(void)
/* NULL context handle and dummy GUID */ /* NULL context handle and dummy GUID */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptCATAdminAcquireContext(NULL, &dummy, 0); ret = pCryptCATAdminAcquireContext(NULL, &dummy, 0);
todo_wine
{
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
/* Correct context handle and dummy GUID */ /* Correct context handle and dummy GUID */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);