advapi32: Fix the ACCESS_SYSTEM_SECURITY test by impersonating the token during the call to RtlAdjustPrivileges.

This commit is contained in:
Rob Shearman 2007-10-25 16:19:37 +01:00 committed by Alexandre Julliard
parent efed229a08
commit 340122abb7
1 changed files with 4 additions and 0 deletions

View File

@ -876,6 +876,8 @@ static void test_AccessCheck(void)
"AccessCheck should have failed with ERROR_PRIVILEGE_NOT_HELD, instead of %d\n",
GetLastError());
ret = ImpersonateLoggedOnUser(Token);
ok(ret, "ImpersonateLoggedOnUser failed with error %d\n", GetLastError());
ret = pRtlAdjustPrivilege(SE_SECURITY_PRIVILEGE, TRUE, TRUE, &Enabled);
if (!ret)
{
@ -893,6 +895,8 @@ static void test_AccessCheck(void)
else
trace("Couldn't get SE_SECURITY_PRIVILEGE (0x%08x), skipping ACCESS_SYSTEM_SECURITY test\n",
ret);
ret = RevertToSelf();
ok(ret, "RevertToSelf failed with error %d\n", GetLastError());
/* test INHERIT_ONLY_ACE */
ret = InitializeAcl(Acl, 256, ACL_REVISION);