diff --git a/server/completion.c b/server/completion.c index 2a8f9ac2cc1..948d7d1045f 100644 --- a/server/completion.c +++ b/server/completion.c @@ -53,8 +53,9 @@ struct completion static void completion_dump( struct object*, int ); static struct object_type *completion_get_type( struct object *obj ); +static int completion_signaled( struct object *obj, struct thread *thread ); +static unsigned int completion_map_access( struct object *obj, unsigned int access ); static void completion_destroy( struct object * ); -static int completion_signaled( struct object *obj, struct thread *thread ); 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;