From 33b8ec1cb5e222f9b8078d2e5d580cdf368a66fb Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Thu, 29 Mar 2007 21:19:32 +0200 Subject: [PATCH] advapi32/tests: Add check to see if ImpersonateSelf is implemented. --- dlls/advapi32/tests/security.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index cdf80844384..88c0d9698f0 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -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");