wintrust/tests: Accept the CryptCATAdminAcquireContext win8 results.

This commit is contained in:
Detlef Riekenberg 2013-11-17 15:18:26 +01:00 committed by Alexandre Julliard
parent 55928a90e5
commit 48ae4314d0
2 changed files with 14 additions and 6 deletions

View File

@ -113,7 +113,7 @@ BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN *catAdmin,
TRACE("%p %s %x\n", catAdmin, debugstr_guid(sys), dwFlags);
if (!catAdmin)
if (!catAdmin || dwFlags)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;

View File

@ -284,13 +284,21 @@ static void test_context(void)
ret = pCryptCATAdminReleaseContext(hca, 0);
ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
/* Flags not equal to 0 */
hca = (void *) 0xdeadbeef;
SetLastError(0xdeadbeef);
/* Flags is documented as unused, but the parameter is checked since win8 */
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 1);
ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
ok(hca != NULL, "Expected a context handle, got NULL\n");
ok((!ret && (GetLastError() == ERROR_INVALID_PARAMETER) && (hca == (void *) 0xdeadbeef)) ||
broken(ret && hca != NULL && hca != (void *) 0xdeadbeef),
"Expected FALSE and ERROR_INVALID_PARAMETER with untouched handle, got %d and %u with %p\n",
ret, GetLastError(), hca);
if (ret && hca)
{
SetLastError(0xdeadbeef);
ret = pCryptCATAdminReleaseContext(hca, 0);
ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
}
}
/* TODO: Check whether SHA-1 is the algorithm that's always used */