server: Correct mapping of mutex access rights.
authorBernhard Loos <bernhardloos@googlemail.com>
Wed, 14 Sep 2011 12:49:09 +0000 (14:49 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 23 Sep 2011 11:05:37 +0000 (13:05 +0200)
dlls/kernel32/tests/sync.c
server/mutex.c

index 169571374b8af8fd74557fc64a67386e796e6108..98d996fabe7d33fac4b20c752dd6facff783582d 100644 (file)
@@ -140,7 +140,7 @@ static void test_mutex(void)
     hOpened = OpenMutex(GENERIC_EXECUTE, FALSE, "WineTestMutex");
     ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError());
     wait_ret = WaitForSingleObject(hOpened, INFINITE);
-    todo_wine ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error %d\n", GetLastError());
+    ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error %d\n", GetLastError());
     CloseHandle(hOpened);
 
     for(i=0; i < 31; i++)
@@ -152,7 +152,7 @@ static void test_mutex(void)
     hOpened = OpenMutex(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex");
     ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError());
     wait_ret = WaitForSingleObject(hOpened, INFINITE);
-    todo_wine ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n");
+    ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n");
     CloseHandle(hOpened);
 
     for (i = 0; i < 32; i++)
index d21f3414f4d41eb98e7173890f6c94eea75f7e7a..7c9700d0347324a16d611e5f2e25afb332a3a921 100644 (file)
@@ -163,9 +163,9 @@ static int mutex_satisfied( struct object *obj, struct thread *thread )
 
 static unsigned int mutex_map_access( struct object *obj, unsigned int access )
 {
-    if (access & GENERIC_READ)    access |= STANDARD_RIGHTS_READ | SYNCHRONIZE;
-    if (access & GENERIC_WRITE)   access |= STANDARD_RIGHTS_WRITE | MUTEX_MODIFY_STATE;
-    if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE;
+    if (access & GENERIC_READ)    access |= STANDARD_RIGHTS_READ;
+    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;
     return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
 }