[3/6] server: Add access mapping for IO completion objects.

Dmitry Timoshkov dmitry at baikal.ru
Fri Mar 16 05:32:02 CDT 2012


---
 server/completion.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/server/completion.c b/server/completion.c
index 2a8f9ac..a0a865e 100644
--- a/server/completion.c
+++ b/server/completion.c
@@ -55,6 +55,7 @@ static void completion_dump( struct object*, int );
 static struct object_type *completion_get_type( struct object *obj );
 static void completion_destroy( struct object * );
 static int  completion_signaled( struct object *obj, struct thread *thread );
+static unsigned int completion_map_access( struct object *obj, unsigned int access );
 
 static const struct object_ops completion_ops =
 {
@@ -67,7 +68,7 @@ static const struct object_ops completion_ops =
     no_satisfied,              /* satisfied */
     no_signal,                 /* signal */
     no_get_fd,                 /* get_fd */
-    no_map_access,             /* map_access */
+    completion_map_access,     /* map_access */
     default_get_sd,            /* get_sd */
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
@@ -120,6 +121,15 @@ static int completion_signaled( struct object *obj, struct thread *thread )
     return !list_empty( &completion->queue );
 }
 
+static unsigned int completion_map_access( struct object *obj, unsigned int access )
+{
+    if (access & GENERIC_READ)    access |= STANDARD_RIGHTS_READ | SYNCHRONIZE | IO_COMPLETION_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 | IO_COMPLETION_ALL_ACCESS;
+    return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
+}
+
 static struct completion *create_completion( struct directory *root, const struct unicode_str *name, unsigned int attr, unsigned int concurrent )
 {
     struct completion *completion;
-- 
1.7.9.2




More information about the wine-patches mailing list