Alexandre Julliard : server: Implement the lookup_name operation for window stations.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Feb 8 10:09:20 CST 2016
Module: wine
Branch: master
Commit: e2ccc978a3dfcb7302e1535d1cf5759b5afe2d82
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e2ccc978a3dfcb7302e1535d1cf5759b5afe2d82
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Feb 8 14:02:45 2016 +0900
server: Implement the lookup_name operation for window stations.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/winstation.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/server/winstation.c b/server/winstation.c
index 9dc348d..dbfece0 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -46,6 +46,8 @@ static struct list winstation_list = LIST_INIT(winstation_list);
static void winstation_dump( struct object *obj, int verbose );
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 struct object *winstation_lookup_name( struct object *obj, struct unicode_str *name,
+ unsigned int attr );
static void winstation_destroy( struct object *obj );
static unsigned int winstation_map_access( struct object *obj, unsigned int access );
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 */
default_get_sd, /* get_sd */
default_set_sd, /* set_sd */
- no_lookup_name, /* lookup_name */
+ winstation_lookup_name, /* lookup_name */
directory_link_name, /* link_name */
default_unlink_name, /* unlink_name */
no_open_file, /* open_file */
@@ -155,6 +157,26 @@ static int winstation_close_handle( struct object *obj, struct process *process,
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 )
{
struct winstation *winstation = (struct winstation *)obj;
More information about the wine-cvs
mailing list