server: Implement the lookup_name operation for window stations.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-02-08 14:02:45 +09:00
parent bfd0dff215
commit e2ccc978a3
1 changed files with 23 additions and 1 deletions

View File

@ -46,6 +46,8 @@ static struct list winstation_list = LIST_INIT(winstation_list);
static void winstation_dump( struct object *obj, int verbose ); static void winstation_dump( struct object *obj, int verbose );
static struct object_type *winstation_get_type( struct object *obj ); static struct object_type *winstation_get_type( struct object *obj );
static int winstation_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static int winstation_close_handle( struct object *obj, struct process *process, obj_handle_t handle );
static struct object *winstation_lookup_name( struct object *obj, struct unicode_str *name,
unsigned int attr );
static void winstation_destroy( struct object *obj ); static void winstation_destroy( struct object *obj );
static unsigned int winstation_map_access( struct object *obj, unsigned int access ); static unsigned int winstation_map_access( struct object *obj, unsigned int access );
static void desktop_dump( struct object *obj, int verbose ); static void desktop_dump( struct object *obj, int verbose );
@ -69,7 +71,7 @@ static const struct object_ops winstation_ops =
winstation_map_access, /* map_access */ winstation_map_access, /* map_access */
default_get_sd, /* get_sd */ default_get_sd, /* get_sd */
default_set_sd, /* set_sd */ default_set_sd, /* set_sd */
no_lookup_name, /* lookup_name */ winstation_lookup_name, /* lookup_name */
directory_link_name, /* link_name */ directory_link_name, /* link_name */
default_unlink_name, /* unlink_name */ default_unlink_name, /* unlink_name */
no_open_file, /* open_file */ no_open_file, /* open_file */
@ -155,6 +157,26 @@ static int winstation_close_handle( struct object *obj, struct process *process,
return (process->winstation != handle); return (process->winstation != handle);
} }
static struct object *winstation_lookup_name( struct object *obj, struct unicode_str *name,
unsigned int attr )
{
struct winstation *winstation = (struct winstation *)obj;
struct object *found;
assert( obj->ops == &winstation_ops );
if (memchrW( name->str, '\\', name->len / sizeof(WCHAR) )) /* no backslash allowed in name */
{
set_error( STATUS_OBJECT_PATH_SYNTAX_BAD );
return NULL;
}
if ((found = find_object( winstation->desktop_names, name, attr )))
name->len = 0;
return found;
}
static void winstation_destroy( struct object *obj ) static void winstation_destroy( struct object *obj )
{ {
struct winstation *winstation = (struct winstation *)obj; struct winstation *winstation = (struct winstation *)obj;