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

Alexandre Julliard julliard at winehq.org
Wed Feb 5 13:18:53 CST 2014


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Feb  5 16:46:55 2014 +0900

server: Fix generic access mapping for a thread.

---

 dlls/advapi32/tests/security.c |    7 +------
 server/thread.c                |    6 +++---
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 8f70faf..87f3ea93 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -4985,7 +4985,7 @@ static void test_thread_security(void)
         switch (map[i].generic)
         {
         case GENERIC_READ:
-todo_wine
+        case GENERIC_EXECUTE:
             ok(access == map[i].mapped || access == (map[i].mapped | THREAD_QUERY_LIMITED_INFORMATION) /* Vista+ */,
                "%d: expected %#x, got %#x\n", i, map[i].mapped, access);
             break;
@@ -4994,11 +4994,6 @@ todo_wine
             ok(access == map[i].mapped || access == (map[i].mapped | THREAD_SET_LIMITED_INFORMATION) /* Vista+ */,
                "%d: expected %#x, got %#x\n", i, map[i].mapped, access);
             break;
-        case GENERIC_EXECUTE:
-todo_wine
-            ok(access == map[i].mapped || access == (map[i].mapped | THREAD_QUERY_LIMITED_INFORMATION) /* Vista+ */,
-               "%d: expected %#x, got %#x\n", i, map[i].mapped, access);
-            break;
         case GENERIC_ALL:
             ok(access == map[i].mapped || access == THREAD_ALL_ACCESS_VISTA,
                "%d: expected %#x, got %#x\n", i, map[i].mapped, access);
diff --git a/server/thread.c b/server/thread.c
index 623a3b3..dd0b6b0 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -331,9 +331,9 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
 
 static unsigned int thread_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 | SYNCHRONIZE;
-    if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE;
+    if (access & GENERIC_READ)    access |= STANDARD_RIGHTS_READ | THREAD_QUERY_INFORMATION | THREAD_GET_CONTEXT;
+    if (access & GENERIC_WRITE)   access |= STANDARD_RIGHTS_WRITE | THREAD_SET_INFORMATION | THREAD_SET_CONTEXT | THREAD_TERMINATE | THREAD_SUSPEND_RESUME;
+    if (access & GENERIC_EXECUTE) access |= STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE;
     if (access & GENERIC_ALL)     access |= THREAD_ALL_ACCESS;
     return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
 }




More information about the wine-cvs mailing list