server: Correct mapping of mutex access rights.

This commit is contained in:
Bernhard Loos 2011-09-14 14:49:09 +02:00 committed by Alexandre Julliard
parent 0d36c27e3b
commit 527a985a3d
2 changed files with 5 additions and 5 deletions

View 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++)

View 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);
}