James Hawkins : advapi32: Fix several failing tests in Vista.

Alexandre Julliard julliard at winehq.org
Fri Aug 29 07:30:01 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Thu Aug 28 21:10:51 2008 -0500

advapi32: Fix several failing tests in Vista.

---

 dlls/advapi32/tests/security.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 9b3f7e6..978cc46 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -1705,8 +1705,10 @@ static void test_security_descriptor(void)
     }
 }
 
-#define TEST_GRANTED_ACCESS(a,b) test_granted_access(a,b,__LINE__)
-static void test_granted_access(HANDLE handle, ACCESS_MASK access, int line)
+#define TEST_GRANTED_ACCESS(a,b) test_granted_access(a,b,0,__LINE__)
+#define TEST_GRANTED_ACCESS2(a,b,c) test_granted_access(a,b,c,__LINE__)
+static void test_granted_access(HANDLE handle, ACCESS_MASK access,
+                                ACCESS_MASK alt, int line)
 {
     OBJECT_BASIC_INFORMATION obj_info;
     NTSTATUS status;
@@ -1720,8 +1722,13 @@ static void test_granted_access(HANDLE handle, ACCESS_MASK access, int line)
     status = pNtQueryObject( handle, ObjectBasicInformation, &obj_info,
                              sizeof(obj_info), NULL );
     ok_(__FILE__, line)(!status, "NtQueryObject with err: %08x\n", status);
-    ok_(__FILE__, line)(obj_info.GrantedAccess == access, "Granted access should "
-        "be 0x%08x, instead of 0x%08x\n", access, obj_info.GrantedAccess);
+    if (alt)
+        ok_(__FILE__, line)(obj_info.GrantedAccess == access ||
+            obj_info.GrantedAccess == alt, "Granted access should be 0x%08x "
+            "or 0x%08x, instead of 0x%08x\n", access, alt, obj_info.GrantedAccess);
+    else
+        ok_(__FILE__, line)(obj_info.GrantedAccess == access, "Granted access should "
+            "be 0x%08x, instead of 0x%08x\n", access, obj_info.GrantedAccess);
 }
 
 #define CHECK_SET_SECURITY(o,i,e) \
@@ -1833,7 +1840,8 @@ static void test_process_security(void)
     /* Doesn't matter what ACL say we should get full access for ourselves */
     ok(CreateProcessA( NULL, buffer, &psa, NULL, FALSE, 0, NULL, NULL, &startup, &info ),
         "CreateProcess with err:%d\n", GetLastError());
-    TEST_GRANTED_ACCESS( info.hProcess, PROCESS_ALL_ACCESS );
+    TEST_GRANTED_ACCESS2( info.hProcess, PROCESS_ALL_ACCESS,
+                          STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL );
     winetest_wait_child_process( info.hProcess );
 
     CloseHandle( info.hProcess );
@@ -1882,7 +1890,8 @@ static void test_process_security_child(void)
     ok(DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(),
                         &handle, 0, TRUE, DUPLICATE_SAME_ACCESS ),
        "duplicating handle err:%d\n", GetLastError());
-    TEST_GRANTED_ACCESS( handle, PROCESS_ALL_ACCESS );
+    TEST_GRANTED_ACCESS2( handle, PROCESS_ALL_ACCESS,
+                          STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL );
 
     CloseHandle( handle );
 
@@ -1890,7 +1899,8 @@ static void test_process_security_child(void)
     ok(DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(),
                         &handle, PROCESS_ALL_ACCESS, TRUE, 0 ),
        "duplicating handle err:%d\n", GetLastError());
-    TEST_GRANTED_ACCESS( handle, PROCESS_ALL_ACCESS );
+    TEST_GRANTED_ACCESS2( handle, PROCESS_ALL_ACCESS,
+                          STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL );
     ok(DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(),
                         &handle1, PROCESS_VM_READ, TRUE, 0 ),
        "duplicating handle err:%d\n", GetLastError());




More information about the wine-cvs mailing list