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
34d59949
Commit
34d59949
authored
Feb 01, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add some tests for window station and desktop object names.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
37503be6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
6 deletions
+58
-6
winstation.c
dlls/user32/tests/winstation.c
+53
-0
winstation.c
dlls/user32/winstation.c
+3
-5
winstation.c
server/winstation.c
+2
-1
No files found.
dlls/user32/tests/winstation.c
View file @
34d59949
...
...
@@ -205,6 +205,35 @@ static void test_handles(void)
else
if
(
le
==
ERROR_ACCESS_DENIED
)
win_skip
(
"Not enough privileges for CreateWindowStation
\n
"
);
SetLastError
(
0xdeadbeef
);
w2
=
OpenWindowStationA
(
""
,
TRUE
,
WINSTA_ALL_ACCESS
);
ok
(
!
w2
,
"open station succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
w2
=
CreateWindowStationA
(
""
,
0
,
WINSTA_ALL_ACCESS
,
NULL
);
ok
(
w2
!=
0
,
"create station failed err %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
w3
=
OpenWindowStationA
(
""
,
TRUE
,
WINSTA_ALL_ACCESS
);
todo_wine
ok
(
w3
!=
0
,
"open station failed err %u
\n
"
,
GetLastError
()
);
CloseWindowStation
(
w3
);
CloseWindowStation
(
w2
);
SetLastError
(
0xdeadbeef
);
w2
=
CreateWindowStationA
(
"foo
\\
bar"
,
0
,
WINSTA_ALL_ACCESS
,
NULL
);
ok
(
!
w2
,
"create station succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
||
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
w2
=
OpenWindowStationA
(
"foo
\\
bar"
,
TRUE
,
WINSTA_ALL_ACCESS
);
ok
(
!
w2
,
"create station succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
,
"wrong error %u
\n
"
,
GetLastError
()
);
/* desktops */
d1
=
GetThreadDesktop
(
GetCurrentThreadId
());
initial_desktop
=
d1
;
...
...
@@ -239,6 +268,30 @@ static void test_handles(void)
d2
=
OpenDesktopA
(
"dummy name"
,
0
,
TRUE
,
DESKTOP_ALL_ACCESS
);
ok
(
!
d2
,
"open dummy desktop succeeded
\n
"
);
SetLastError
(
0xdeadbeef
);
d2
=
CreateDesktopA
(
""
,
NULL
,
NULL
,
0
,
DESKTOP_ALL_ACCESS
,
NULL
);
todo_wine
ok
(
!
d2
,
"create empty desktop succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
d2
=
OpenDesktopA
(
""
,
0
,
TRUE
,
DESKTOP_ALL_ACCESS
);
ok
(
!
d2
,
"open mepty desktop succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
d2
=
CreateDesktopA
(
"foo
\\
bar"
,
NULL
,
NULL
,
0
,
DESKTOP_ALL_ACCESS
,
NULL
);
ok
(
!
d2
,
"create desktop succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_BAD_PATHNAME
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
d2
=
OpenDesktopA
(
"foo
\\
bar"
,
0
,
TRUE
,
DESKTOP_ALL_ACCESS
);
ok
(
!
d2
,
"open desktop succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_BAD_PATHNAME
,
"wrong error %u
\n
"
,
GetLastError
()
);
d2
=
CreateDesktopA
(
"foobar"
,
NULL
,
NULL
,
0
,
DESKTOP_ALL_ACCESS
,
NULL
);
ok
(
d2
!=
0
,
"create foobar desktop failed
\n
"
);
SetLastError
(
0xdeadbeef
);
...
...
dlls/user32/winstation.c
View file @
34d59949
...
...
@@ -118,8 +118,7 @@ HWINSTA WINAPI CreateWindowStationW( LPCWSTR name, DWORD reserved, ACCESS_MASK a
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
req
->
rootdir
=
wine_server_obj_handle
(
get_winstations_dir_handle
()
);
wine_server_add_data
(
req
,
name
,
len
*
sizeof
(
WCHAR
)
);
/* it doesn't seem to set last error */
wine_server_call
(
req
);
wine_server_call_err
(
req
);
ret
=
wine_server_ptr_handle
(
reply
->
handle
);
}
SERVER_END_REQ
;
...
...
@@ -316,8 +315,7 @@ HDESK WINAPI CreateDesktopW( LPCWSTR name, LPCWSTR device, LPDEVMODEW devmode,
req
->
attributes
=
OBJ_CASE_INSENSITIVE
|
OBJ_OPENIF
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
wine_server_add_data
(
req
,
name
,
len
*
sizeof
(
WCHAR
)
);
/* it doesn't seem to set last error */
wine_server_call
(
req
);
wine_server_call_err
(
req
);
ret
=
wine_server_ptr_handle
(
reply
->
handle
);
}
SERVER_END_REQ
;
...
...
@@ -359,7 +357,7 @@ HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL
req
->
access
=
access
;
req
->
attributes
=
OBJ_CASE_INSENSITIVE
|
(
inherit
?
OBJ_INHERIT
:
0
);
wine_server_add_data
(
req
,
name
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
wine_server_call
(
req
))
ret
=
wine_server_ptr_handle
(
reply
->
handle
);
if
(
!
wine_server_call
_err
(
req
))
ret
=
wine_server_ptr_handle
(
reply
->
handle
);
}
SERVER_END_REQ
;
return
ret
;
...
...
server/winstation.c
View file @
34d59949
...
...
@@ -191,7 +191,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
if
(
memchrW
(
name
->
str
,
'\\'
,
name
->
len
/
sizeof
(
WCHAR
)
))
/* no backslash allowed in name */
{
set_error
(
STATUS_
INVALID_PARAMETER
);
set_error
(
STATUS_
OBJECT_PATH_SYNTAX_BAD
);
return
NULL
;
}
...
...
@@ -213,6 +213,7 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
list_add_tail
(
&
winstation
->
desktops
,
&
desktop
->
entry
);
list_init
(
&
desktop
->
hotkeys
);
}
else
clear_error
();
}
return
desktop
;
}
...
...
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