From f4c8a0fadd30e890529dd609bfc983d625175ceb Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Mon, 8 Sep 2008 00:44:07 -0500 Subject: [PATCH] advapi32: ERROR_IO_PENDING is returned in Vista only on success. --- dlls/advapi32/tests/cred.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/advapi32/tests/cred.c b/dlls/advapi32/tests/cred.c index 1bb2545e47b..df14439bc0f 100644 --- a/dlls/advapi32/tests/cred.c +++ b/dlls/advapi32/tests/cred.c @@ -97,12 +97,19 @@ static void test_CredWriteA(void) SetLastError(0xdeadbeef); ret = pCredWriteA(&new_cred, 0); - ok(!ret, "CredWrite with username without domain should have failed\n"); - ok(GetLastError() == ERROR_BAD_USERNAME || - GetLastError() == ERROR_NO_SUCH_LOGON_SESSION || /* Vista */ - broken(GetLastError() == ERROR_IO_PENDING), - "CredWrite with username without domain should return ERROR_BAD_USERNAME" - "or ERROR_NO_SUCH_LOGON_SESSION not %d\n", GetLastError()); + if (ret) + { + /* Vista */ + ok(GetLastError() == ERROR_IO_PENDING, + "Expected ERROR_IO_PENDING, got %d\n", GetLastError()); + } + else + { + ok(GetLastError() == ERROR_BAD_USERNAME || + GetLastError() == ERROR_NO_SUCH_LOGON_SESSION, /* Vista */ + "CredWrite with username without domain should return ERROR_BAD_USERNAME" + "or ERROR_NO_SUCH_LOGON_SESSION not %d\n", GetLastError()); + } new_cred.UserName = NULL; SetLastError(0xdeadbeef);