wintrust: Don't test last error on success.
This commit is contained in:
parent
0b0621c8cb
commit
976341a45e
|
@ -102,12 +102,8 @@ static void test_context(void)
|
||||||
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
|
||||||
/* NULL GUID */
|
/* NULL GUID */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
ret = pCryptCATAdminAcquireContext(&hca, NULL, 0);
|
ret = pCryptCATAdminAcquireContext(&hca, NULL, 0);
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
ok(GetLastError() == ERROR_SUCCESS ||
|
|
||||||
GetLastError() == 0xdeadbeef /* Vista */,
|
|
||||||
"Expected ERROR_SUCCESS or 0xdeadbeef, got %d\n", GetLastError());
|
|
||||||
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
||||||
|
|
||||||
/* All NULL */
|
/* All NULL */
|
||||||
|
@ -154,12 +150,8 @@ static void test_context(void)
|
||||||
* save to remove files and directories from CatRoot/CatRoot2.
|
* save to remove files and directories from CatRoot/CatRoot2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
ret = pCryptCATAdminAcquireContext(&hca, &dummy, 0);
|
ret = pCryptCATAdminAcquireContext(&hca, &dummy, 0);
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
ok(GetLastError() == ERROR_SUCCESS ||
|
|
||||||
GetLastError() == 0xdeadbeef /* Vista */,
|
|
||||||
"Expected ERROR_SUCCESS or 0xdeadbeef, got %d\n", GetLastError());
|
|
||||||
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
||||||
|
|
||||||
GetWindowsDirectoryA(windir, MAX_PATH);
|
GetWindowsDirectoryA(windir, MAX_PATH);
|
||||||
|
@ -199,24 +191,16 @@ static void test_context(void)
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
|
|
||||||
/* Correct context handle and GUID */
|
/* Correct context handle and GUID */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 0);
|
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 0);
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
ok(GetLastError() == ERROR_SUCCESS ||
|
|
||||||
GetLastError() == 0xdeadbeef /* Vista */,
|
|
||||||
"Expected ERROR_SUCCESS or 0xdeadbeef, got %d\n", GetLastError());
|
|
||||||
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
||||||
|
|
||||||
ret = pCryptCATAdminReleaseContext(hca, 0);
|
ret = pCryptCATAdminReleaseContext(hca, 0);
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
|
|
||||||
/* Flags not equal to 0 */
|
/* Flags not equal to 0 */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 1);
|
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 1);
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
ok(GetLastError() == ERROR_SUCCESS ||
|
|
||||||
GetLastError() == 0xdeadbeef /* Vista */,
|
|
||||||
"Expected ERROR_SUCCESS or 0xdeadbeef, got %d\n", GetLastError());
|
|
||||||
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
ok(hca != NULL, "Expected a context handle, got NULL\n");
|
||||||
|
|
||||||
ret = pCryptCATAdminReleaseContext(hca, 0);
|
ret = pCryptCATAdminReleaseContext(hca, 0);
|
||||||
|
|
Loading…
Reference in New Issue