From 5953851b8afc184e58727691d7dc737bd211a75c Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 16 Jan 2014 18:32:52 +0900 Subject: [PATCH] server: Fix generic access mapping for an event. --- dlls/advapi32/tests/security.c | 16 ++++++---------- server/event.c | 8 ++++---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 2efe80ee341..6f98c703148 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -4600,14 +4600,14 @@ static void test_event_security(HANDLE token) STANDARD_RIGHTS_ALL | EVENT_ALL_ACCESS }; static const struct { - int todo, generic, mapped; + int generic, mapped; } map[] = { - { 0, 0, 0 }, - { 1, GENERIC_READ, STANDARD_RIGHTS_READ | EVENT_QUERY_STATE }, - { 1, GENERIC_WRITE, STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE }, - { 1, GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, - { 0, GENERIC_ALL, STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE } + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | EVENT_QUERY_STATE }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, + { GENERIC_ALL, STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE } }; SetLastError(0xdeadbeef); @@ -4630,10 +4630,6 @@ static void test_event_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/event.c b/server/event.c index b8515af62e9..4d3c5621fca 100644 --- a/server/event.c +++ b/server/event.c @@ -183,10 +183,10 @@ static void event_satisfied( struct object *obj, struct wait_queue_entry *entry static unsigned int event_map_access( struct object *obj, unsigned int access ) { - if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | SYNCHRONIZE | EVENT_QUERY_STATE; - if (access & GENERIC_WRITE) access |= STANDARD_RIGHTS_WRITE; - if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE; - if (access & GENERIC_ALL) access |= STANDARD_RIGHTS_ALL | EVENT_ALL_ACCESS; + if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | EVENT_QUERY_STATE; + if (access & GENERIC_WRITE) access |= STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE; + if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE; + if (access & GENERIC_ALL) access |= STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE; return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); } -- 2.11.4.GIT