server: Add access mapping for IO completion objects.

This commit is contained in:
Dmitry Timoshkov 2012-04-17 17:02:19 +09:00 committed by Alexandre Julliard
parent d4e57b1598
commit 16b7a7f707
1 changed files with 12 additions and 2 deletions

View File

@ -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;