Commit 20507a7c authored by Zebediah Figura's avatar Zebediah Figura Committed by Vitaly Lipatov

server: Implement esync_map_access().

parent dbd67501
......@@ -112,6 +112,7 @@ struct esync
};
static void esync_dump( struct object *obj, int verbose );
static unsigned int esync_map_access( struct object *obj, unsigned int access );
static void esync_destroy( struct object *obj );
const struct object_ops esync_ops =
......@@ -126,7 +127,7 @@ const struct object_ops esync_ops =
NULL, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
no_map_access, /* map_access */
esync_map_access, /* map_access */
default_get_sd, /* get_sd */
default_set_sd, /* set_sd */
default_get_full_name, /* get_full_name */
......@@ -146,6 +147,16 @@ static void esync_dump( struct object *obj, int verbose )
fprintf( stderr, "esync fd=%d\n", esync->fd );
}
static unsigned int esync_map_access( struct object *obj, unsigned int access )
{
/* Sync objects have the same flags. */
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);
}
static void esync_destroy( struct object *obj )
{
struct esync *esync = (struct esync *)obj;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment