server: ReleaseMutex doesn't need any access rights.
authorBernhard Loos <bernhardloos@googlemail.com>
Wed, 14 Sep 2011 12:49:03 +0000 (14:49 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 23 Sep 2011 11:05:33 +0000 (13:05 +0200)
dlls/kernel32/tests/sync.c
server/mutex.c

index dd87f3e32ff6e22b328c6b6fa2a05cfb4ad1e994..169571374b8af8fd74557fc64a67386e796e6108 100644 (file)
@@ -158,13 +158,15 @@ static void test_mutex(void)
     for (i = 0; i < 32; i++)
     {
         hOpened = OpenMutex(0x1 << i, FALSE, "WineTestMutex");
-        ReleaseMutex(hCreated);
         if(hOpened != NULL)
         {
+            ret = ReleaseMutex(hOpened);
+            ok(ret, "ReleaseMutex failed with error %d, access %x\n", GetLastError(), 1 << i);
             CloseHandle(hOpened);
         }
         else
         {
+            ReleaseMutex(hCreated);
             failed |=0x1 << i;
         }
     }
index faedcf39d4dbb3721f8703a1df1e8ae53243aafa..d21f3414f4d41eb98e7173890f6c94eea75f7e7a 100644 (file)
@@ -175,7 +175,7 @@ static int mutex_signal( struct object *obj, unsigned int access )
     struct mutex *mutex = (struct mutex *)obj;
     assert( obj->ops == &mutex_ops );
 
-    if (!(access & SYNCHRONIZE))  /* FIXME: MUTEX_MODIFY_STATE? */
+    if (!(access & SYNCHRONIZE))
     {
         set_error( STATUS_ACCESS_DENIED );
         return 0;
@@ -265,7 +265,7 @@ DECL_HANDLER(release_mutex)
     struct mutex *mutex;
 
     if ((mutex = (struct mutex *)get_handle_obj( current->process, req->handle,
-                                                 MUTEX_MODIFY_STATE, &mutex_ops )))
+                                                 0, &mutex_ops )))
     {
         if (!mutex->count || (mutex->owner != current)) set_error( STATUS_MUTANT_NOT_OWNED );
         else