Dmitry Timoshkov : server: Fix generic access mapping for a mutex.

Alexandre Julliard julliard at winehq.org
Thu Jan 30 13:25:26 CST 2014


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Jan 30 14:48:10 2014 +0900

server: Fix generic access mapping for a mutex.

---

 dlls/advapi32/tests/security.c |   16 ++++++----------
 server/mutex.c                 |    2 +-
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 6f98c70..e649674 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -4539,14 +4539,14 @@ static void test_mutex_security(HANDLE token)
                                 STANDARD_RIGHTS_ALL | MUTEX_ALL_ACCESS };
     static const struct
     {
-        int todo, generic, mapped;
+        int generic, mapped;
     } map[] =
     {
-        { 0, 0, 0 },
-        { 1, GENERIC_READ, STANDARD_RIGHTS_READ | MUTANT_QUERY_STATE },
-        { 0, GENERIC_WRITE, STANDARD_RIGHTS_WRITE },
-        { 0, GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE },
-        { 0, GENERIC_ALL, STANDARD_RIGHTS_ALL | MUTANT_QUERY_STATE }
+        { 0, 0 },
+        { GENERIC_READ, STANDARD_RIGHTS_READ | MUTANT_QUERY_STATE },
+        { GENERIC_WRITE, STANDARD_RIGHTS_WRITE },
+        { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE },
+        { GENERIC_ALL, STANDARD_RIGHTS_ALL | MUTANT_QUERY_STATE }
     };
 
     SetLastError(0xdeadbeef);
@@ -4569,10 +4569,6 @@ static void test_mutex_security(HANDLE token)
         ok(ret, "DuplicateHandle error %d\n", GetLastError());
 
         access = get_obj_access(dup);
-        if (map[i].todo)
-todo_wine
-        ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access);
-        else
         ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access);
 
         CloseHandle(dup);
diff --git a/server/mutex.c b/server/mutex.c
index 3b6f2c0..910fbca 100644
--- a/server/mutex.c
+++ b/server/mutex.c
@@ -169,7 +169,7 @@ static void mutex_satisfied( struct object *obj, struct wait_queue_entry *entry
 
 static unsigned int mutex_map_access( struct object *obj, unsigned int access )
 {
-    if (access & GENERIC_READ)    access |= STANDARD_RIGHTS_READ;
+    if (access & GENERIC_READ)    access |= STANDARD_RIGHTS_READ | MUTANT_QUERY_STATE;
     if (access & GENERIC_WRITE)   access |= STANDARD_RIGHTS_WRITE;
     if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE;
     if (access & GENERIC_ALL)     access |= STANDARD_RIGHTS_ALL | MUTEX_ALL_ACCESS;




More information about the wine-cvs mailing list