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

Alexandre Julliard julliard at winehq.org
Fri Oct 26 08:34:40 CDT 2007


Module: wine
Branch: master
Commit: 340122abb7b21afecb8af9421460ac708f1aa9bb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=340122abb7b21afecb8af9421460ac708f1aa9bb

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu Oct 25 16:19:37 2007 +0100

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

---

 dlls/advapi32/tests/security.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 22e7c02..7a5c074 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -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);




More information about the wine-cvs mailing list