Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fcc977c1
Commit
fcc977c1
authored
Jan 20, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store the desktop object names inside their window station.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
546289dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
64 deletions
+49
-64
winstation.c
dlls/user32/tests/winstation.c
+1
-1
user.h
server/user.h
+1
-0
winstation.c
server/winstation.c
+47
-63
No files found.
dlls/user32/tests/winstation.c
View file @
fcc977c1
...
@@ -452,7 +452,7 @@ static void test_getuserobjectinformation(void)
...
@@ -452,7 +452,7 @@ static void test_getuserobjectinformation(void)
name_info
=
(
OBJECT_NAME_INFORMATION
*
)
buffer
;
name_info
=
(
OBJECT_NAME_INFORMATION
*
)
buffer
;
status
=
pNtQueryObject
(
desk
,
ObjectNameInformation
,
name_info
,
sizeof
(
buffer
),
NULL
);
status
=
pNtQueryObject
(
desk
,
ObjectNameInformation
,
name_info
,
sizeof
(
buffer
),
NULL
);
ok
(
!
status
,
"expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
!
status
,
"expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
todo_wine
ok
(
lstrcmpW
(
name_info
->
Name
.
Buffer
,
foobarTestW
)
==
0
,
ok
(
lstrcmpW
(
name_info
->
Name
.
Buffer
,
foobarTestW
)
==
0
,
"expected '
\\
foobarTest', got %s
\n
"
,
wine_dbgstr_w
(
name_info
->
Name
.
Buffer
));
"expected '
\\
foobarTest', got %s
\n
"
,
wine_dbgstr_w
(
name_info
->
Name
.
Buffer
));
/** Tests for UOI_TYPE **/
/** Tests for UOI_TYPE **/
...
...
server/user.h
View file @
fcc977c1
...
@@ -49,6 +49,7 @@ struct winstation
...
@@ -49,6 +49,7 @@ struct winstation
struct
list
desktops
;
/* list of desktops of this winstation */
struct
list
desktops
;
/* list of desktops of this winstation */
struct
clipboard
*
clipboard
;
/* clipboard information */
struct
clipboard
*
clipboard
;
/* clipboard information */
struct
atom_table
*
atom_table
;
/* global atom table */
struct
atom_table
*
atom_table
;
/* global atom table */
struct
namespace
*
desktop_names
;
/* namespace for desktops of this winstation */
};
};
struct
global_cursor
struct
global_cursor
...
...
server/winstation.c
View file @
fcc977c1
...
@@ -42,7 +42,6 @@
...
@@ -42,7 +42,6 @@
static
struct
list
winstation_list
=
LIST_INIT
(
winstation_list
);
static
struct
list
winstation_list
=
LIST_INIT
(
winstation_list
);
static
struct
namespace
*
winstation_namespace
;
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
);
...
@@ -104,9 +103,6 @@ static struct winstation *create_winstation( struct directory *root, const struc
...
@@ -104,9 +103,6 @@ static struct winstation *create_winstation( struct directory *root, const struc
{
{
struct
winstation
*
winstation
;
struct
winstation
*
winstation
;
if
(
!
winstation_namespace
&&
!
(
winstation_namespace
=
create_namespace
(
7
)))
return
NULL
;
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
/* no backslash allowed in name */
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
/* no backslash allowed in name */
{
{
set_error
(
STATUS_INVALID_PARAMETER
);
set_error
(
STATUS_INVALID_PARAMETER
);
...
@@ -123,6 +119,11 @@ static struct winstation *create_winstation( struct directory *root, const struc
...
@@ -123,6 +119,11 @@ static struct winstation *create_winstation( struct directory *root, const struc
winstation
->
atom_table
=
NULL
;
winstation
->
atom_table
=
NULL
;
list_add_tail
(
&
winstation_list
,
&
winstation
->
entry
);
list_add_tail
(
&
winstation_list
,
&
winstation
->
entry
);
list_init
(
&
winstation
->
desktops
);
list_init
(
&
winstation
->
desktops
);
if
(
!
(
winstation
->
desktop_names
=
create_namespace
(
7
)))
{
release_object
(
winstation
);
return
NULL
;
}
}
}
}
}
return
winstation
;
return
winstation
;
...
@@ -157,6 +158,7 @@ static void winstation_destroy( struct object *obj )
...
@@ -157,6 +158,7 @@ static void winstation_destroy( struct object *obj )
list_remove
(
&
winstation
->
entry
);
list_remove
(
&
winstation
->
entry
);
if
(
winstation
->
clipboard
)
release_object
(
winstation
->
clipboard
);
if
(
winstation
->
clipboard
)
release_object
(
winstation
->
clipboard
);
if
(
winstation
->
atom_table
)
release_object
(
winstation
->
atom_table
);
if
(
winstation
->
atom_table
)
release_object
(
winstation
->
atom_table
);
free
(
winstation
->
desktop_names
);
}
}
static
unsigned
int
winstation_map_access
(
struct
object
*
obj
,
unsigned
int
access
)
static
unsigned
int
winstation_map_access
(
struct
object
*
obj
,
unsigned
int
access
)
...
@@ -177,32 +179,6 @@ struct winstation *get_process_winstation( struct process *process, unsigned int
...
@@ -177,32 +179,6 @@ struct winstation *get_process_winstation( struct process *process, unsigned int
access
,
&
winstation_ops
);
access
,
&
winstation_ops
);
}
}
/* build the full name of a desktop object */
static
WCHAR
*
build_desktop_name
(
const
struct
unicode_str
*
name
,
struct
winstation
*
winstation
,
struct
unicode_str
*
res
)
{
const
WCHAR
*
winstation_name
;
WCHAR
*
full_name
;
data_size_t
winstation_len
;
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
NULL
;
}
if
(
!
(
winstation_name
=
get_object_name
(
&
winstation
->
obj
,
&
winstation_len
)))
winstation_len
=
0
;
res
->
len
=
winstation_len
+
name
->
len
+
sizeof
(
WCHAR
);
if
(
!
(
full_name
=
mem_alloc
(
res
->
len
)))
return
NULL
;
memcpy
(
full_name
,
winstation_name
,
winstation_len
);
full_name
[
winstation_len
/
sizeof
(
WCHAR
)]
=
'\\'
;
memcpy
(
full_name
+
winstation_len
/
sizeof
(
WCHAR
)
+
1
,
name
->
str
,
name
->
len
);
res
->
str
=
full_name
;
return
full_name
;
}
/* retrieve a pointer to a desktop object */
/* retrieve a pointer to a desktop object */
struct
desktop
*
get_desktop_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
)
struct
desktop
*
get_desktop_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
)
{
{
...
@@ -214,12 +190,14 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
...
@@ -214,12 +190,14 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
unsigned
int
flags
,
struct
winstation
*
winstation
)
unsigned
int
flags
,
struct
winstation
*
winstation
)
{
{
struct
desktop
*
desktop
;
struct
desktop
*
desktop
;
struct
unicode_str
full_str
;
WCHAR
*
full_name
;
if
(
!
(
full_name
=
build_desktop_name
(
name
,
winstation
,
&
full_str
)))
return
NULL
;
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
/* no backslash allowed in name */
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
NULL
;
}
if
((
desktop
=
create_named_object
(
winstation
_namespace
,
&
desktop_ops
,
&
full_str
,
attr
)))
if
((
desktop
=
create_named_object
(
winstation
->
desktop_names
,
&
desktop_ops
,
name
,
attr
)))
{
{
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
if
(
get_error
()
!=
STATUS_OBJECT_NAME_EXISTS
)
{
{
...
@@ -238,7 +216,6 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
...
@@ -238,7 +216,6 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
list_init
(
&
desktop
->
hotkeys
);
list_init
(
&
desktop
->
hotkeys
);
}
}
}
}
free
(
full_name
);
return
desktop
;
return
desktop
;
}
}
...
@@ -423,21 +400,6 @@ void close_thread_desktop( struct thread *thread )
...
@@ -423,21 +400,6 @@ void close_thread_desktop( struct thread *thread )
if
(
handle
)
close_handle
(
thread
->
process
,
handle
);
if
(
handle
)
close_handle
(
thread
->
process
,
handle
);
}
}
/* set the reply data from the object name */
static
void
set_reply_data_obj_name
(
struct
object
*
obj
,
int
full_name
)
{
data_size_t
len
;
const
WCHAR
*
ptr
,
*
name
=
get_object_name
(
obj
,
&
len
);
/* if there is a backslash return the part of the name after it */
if
(
name
&&
!
full_name
&&
(
ptr
=
memchrW
(
name
,
'\\'
,
len
/
sizeof
(
WCHAR
)
)))
{
len
-=
(
ptr
+
1
-
name
)
*
sizeof
(
WCHAR
);
name
=
ptr
+
1
;
}
if
(
name
)
set_reply_data
(
name
,
min
(
len
,
get_reply_max_size
()
));
}
/* create a window station */
/* create a window station */
DECL_HANDLER
(
create_winstation
)
DECL_HANDLER
(
create_winstation
)
{
{
...
@@ -547,15 +509,8 @@ DECL_HANDLER(open_desktop)
...
@@ -547,15 +509,8 @@ DECL_HANDLER(open_desktop)
if
(
winstation
)
if
(
winstation
)
{
{
struct
unicode_str
full_str
;
reply
->
handle
=
open_object
(
winstation
->
desktop_names
,
&
name
,
&
desktop_ops
,
WCHAR
*
full_name
;
req
->
access
,
req
->
attributes
);
if
((
full_name
=
build_desktop_name
(
&
name
,
winstation
,
&
full_str
)))
{
reply
->
handle
=
open_object
(
winstation_namespace
,
&
full_str
,
&
desktop_ops
,
req
->
access
,
req
->
attributes
);
free
(
full_name
);
}
release_object
(
winstation
);
release_object
(
winstation
);
}
}
}
}
...
@@ -658,6 +613,7 @@ DECL_HANDLER(set_thread_desktop)
...
@@ -658,6 +613,7 @@ DECL_HANDLER(set_thread_desktop)
DECL_HANDLER
(
set_user_object_info
)
DECL_HANDLER
(
set_user_object_info
)
{
{
struct
object
*
obj
;
struct
object
*
obj
;
data_size_t
len
;
if
(
!
(
obj
=
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
NULL
)))
return
;
if
(
!
(
obj
=
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
NULL
)))
return
;
...
@@ -681,8 +637,30 @@ DECL_HANDLER(set_user_object_info)
...
@@ -681,8 +637,30 @@ DECL_HANDLER(set_user_object_info)
release_object
(
obj
);
release_object
(
obj
);
return
;
return
;
}
}
if
(
get_reply_max_size
())
if
(
obj
->
ops
==
&
desktop_ops
&&
get_reply_max_size
()
&&
(
req
->
flags
&
SET_USER_OBJECT_GET_FULL_NAME
))
set_reply_data_obj_name
(
obj
,
(
req
->
flags
&
SET_USER_OBJECT_GET_FULL_NAME
)
!=
0
);
{
struct
desktop
*
desktop
=
(
struct
desktop
*
)
obj
;
data_size_t
winstation_len
,
desktop_len
;
const
WCHAR
*
winstation_name
=
get_object_name
(
&
desktop
->
winstation
->
obj
,
&
winstation_len
);
const
WCHAR
*
desktop_name
=
get_object_name
(
obj
,
&
desktop_len
);
WCHAR
*
full_name
;
if
(
!
winstation_name
)
winstation_len
=
0
;
if
(
!
desktop_name
)
desktop_len
=
0
;
len
=
winstation_len
+
desktop_len
+
sizeof
(
WCHAR
);
if
((
full_name
=
mem_alloc
(
len
)))
{
memcpy
(
full_name
,
winstation_name
,
winstation_len
);
full_name
[
winstation_len
/
sizeof
(
WCHAR
)]
=
'\\'
;
memcpy
(
full_name
+
winstation_len
/
sizeof
(
WCHAR
)
+
1
,
desktop_name
,
desktop_len
);
set_reply_data_ptr
(
full_name
,
min
(
len
,
get_reply_max_size
()
));
}
}
else
{
const
WCHAR
*
name
=
get_object_name
(
obj
,
&
len
);
if
(
name
)
set_reply_data
(
name
,
min
(
len
,
get_reply_max_size
()
));
}
release_object
(
obj
);
release_object
(
obj
);
}
}
...
@@ -692,15 +670,18 @@ DECL_HANDLER(enum_winstation)
...
@@ -692,15 +670,18 @@ DECL_HANDLER(enum_winstation)
{
{
unsigned
int
index
=
0
;
unsigned
int
index
=
0
;
struct
winstation
*
winsta
;
struct
winstation
*
winsta
;
const
WCHAR
*
name
;
data_size_t
len
;
LIST_FOR_EACH_ENTRY
(
winsta
,
&
winstation_list
,
struct
winstation
,
entry
)
LIST_FOR_EACH_ENTRY
(
winsta
,
&
winstation_list
,
struct
winstation
,
entry
)
{
{
unsigned
int
access
=
WINSTA_ENUMERATE
;
unsigned
int
access
=
WINSTA_ENUMERATE
;
if
(
req
->
index
>
index
++
)
continue
;
if
(
req
->
index
>
index
++
)
continue
;
if
(
!
check_object_access
(
&
winsta
->
obj
,
&
access
))
continue
;
if
(
!
check_object_access
(
&
winsta
->
obj
,
&
access
))
continue
;
set_reply_data_obj_name
(
&
winsta
->
obj
,
0
);
clear_error
();
clear_error
();
reply
->
next
=
index
;
reply
->
next
=
index
;
if
((
name
=
get_object_name
(
&
winsta
->
obj
,
&
len
)))
set_reply_data
(
name
,
min
(
len
,
get_reply_max_size
()
));
return
;
return
;
}
}
set_error
(
STATUS_NO_MORE_ENTRIES
);
set_error
(
STATUS_NO_MORE_ENTRIES
);
...
@@ -713,6 +694,8 @@ DECL_HANDLER(enum_desktop)
...
@@ -713,6 +694,8 @@ DECL_HANDLER(enum_desktop)
struct
winstation
*
winstation
;
struct
winstation
*
winstation
;
struct
desktop
*
desktop
;
struct
desktop
*
desktop
;
unsigned
int
index
=
0
;
unsigned
int
index
=
0
;
const
WCHAR
*
name
;
data_size_t
len
;
if
(
!
(
winstation
=
(
struct
winstation
*
)
get_handle_obj
(
current
->
process
,
req
->
winstation
,
if
(
!
(
winstation
=
(
struct
winstation
*
)
get_handle_obj
(
current
->
process
,
req
->
winstation
,
WINSTA_ENUMDESKTOPS
,
&
winstation_ops
)))
WINSTA_ENUMDESKTOPS
,
&
winstation_ops
)))
...
@@ -724,7 +707,8 @@ DECL_HANDLER(enum_desktop)
...
@@ -724,7 +707,8 @@ DECL_HANDLER(enum_desktop)
if
(
req
->
index
>
index
++
)
continue
;
if
(
req
->
index
>
index
++
)
continue
;
if
(
!
desktop
->
obj
.
name
)
continue
;
if
(
!
desktop
->
obj
.
name
)
continue
;
if
(
!
check_object_access
(
&
desktop
->
obj
,
&
access
))
continue
;
if
(
!
check_object_access
(
&
desktop
->
obj
,
&
access
))
continue
;
set_reply_data_obj_name
(
&
desktop
->
obj
,
0
);
if
((
name
=
get_object_name
(
&
desktop
->
obj
,
&
len
)))
set_reply_data
(
name
,
min
(
len
,
get_reply_max_size
()
));
release_object
(
winstation
);
release_object
(
winstation
);
clear_error
();
clear_error
();
reply
->
next
=
index
;
reply
->
next
=
index
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment