advapi32/tests: Move check for ERROR_CALL_NOT_IMPLEMENTED to the first call.

This commit is contained in:
Paul Vriens 2007-03-29 20:47:14 +02:00 committed by Alexandre Julliard
parent 640cb29bb7
commit e54247b10c
1 changed files with 8 additions and 8 deletions

View File

@ -857,7 +857,13 @@ static void test_token_attr(void)
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
/* cygwin-like use case */ /* cygwin-like use case */
SetLastError(0xdeadbeef);
ret = OpenProcessToken(GetCurrentProcess(), MAXIMUM_ALLOWED, &Token); ret = OpenProcessToken(GetCurrentProcess(), MAXIMUM_ALLOWED, &Token);
if(!ret && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
{
skip("OpenProcessToken is not implemented\n");
return;
}
ok(ret, "OpenProcessToken failed with error %d\n", GetLastError()); ok(ret, "OpenProcessToken failed with error %d\n", GetLastError());
if (ret) if (ret)
{ {
@ -878,15 +884,9 @@ static void test_token_attr(void)
return; return;
} }
SetLastError(0xdeadbeef);
ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, &Token); ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, &Token);
GLE = GetLastError(); ok(ret, "OpenProcessToken failed with error %d\n", GetLastError());
ok(ret || (GLE == ERROR_CALL_NOT_IMPLEMENTED),
"OpenProcessToken failed with error %d\n", GLE);
if(!ret && (GLE == ERROR_CALL_NOT_IMPLEMENTED))
{
trace("OpenProcessToken() not implemented, skipping test_token_attr()\n");
return;
}
/* groups */ /* groups */
ret = GetTokenInformation(Token, TokenGroups, NULL, 0, &Size); ret = GetTokenInformation(Token, TokenGroups, NULL, 0, &Size);