Commit 33b8ec1c authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

advapi32/tests: Add check to see if ImpersonateSelf is implemented.

parent 333de16f
......@@ -1608,10 +1608,16 @@ static void test_impersonation_level(void)
pDuplicateTokenEx = (fnDuplicateTokenEx) GetProcAddress(hmod, "DuplicateTokenEx");
if( !pDuplicateTokenEx ) {
skip("DuplicateTokenEx\n");
skip("DuplicateTokenEx is not available\n");
return;
}
SetLastError(0xdeadbeef);
ret = ImpersonateSelf(SecurityAnonymous);
if(!ret && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
{
skip("ImpersonateSelf is not implemented\n");
return;
}
ok(ret, "ImpersonateSelf(SecurityAnonymous) failed with error %d\n", GetLastError());
ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY_SOURCE | TOKEN_IMPERSONATE | TOKEN_ADJUST_DEFAULT, TRUE, &Token);
ok(!ret, "OpenThreadToken should have failed\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment