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
74bf784b
Commit
74bf784b
authored
Feb 21, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 23, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use the startup info to connect the process winstation.
This changes the todos in the tests as it fixes the thread input not being attached, but then exposes a different todo.
parent
c55f5d87
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
24 deletions
+45
-24
joystick8.c
dlls/dinput/tests/joystick8.c
+9
-14
input.c
dlls/user32/tests/input.c
+4
-4
process.c
server/process.c
+4
-2
user.h
server/user.h
+3
-2
winstation.c
server/winstation.c
+25
-2
No files found.
dlls/dinput/tests/joystick8.c
View file @
74bf784b
...
...
@@ -5756,23 +5756,23 @@ static DWORD WINAPI test_rawinput_desktop_thread( void *args )
rawbuffer_size
=
sizeof
(
rawbuffer
);
memset
(
rawbuffer
,
0
,
sizeof
(
rawbuffer
)
);
res
=
msg_wait_for_events
(
1
,
&
rawinput_event
,
100
);
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
res
==
0
,
"WaitForSingleObject returned %#lx
\n
"
,
res
);
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
rawinput_calls
==
1
,
"got %u WM_INPUT messages
\n
"
,
rawinput_calls
);
rawinput
=
(
RAWINPUT
*
)
rawbuffer
;
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
rawinput
->
header
.
dwType
==
RIM_TYPEHID
,
"got dwType %lu
\n
"
,
rawinput
->
header
.
dwType
);
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
rawinput
->
header
.
dwSize
==
offsetof
(
RAWINPUT
,
data
.
hid
.
bRawData
[
desc
.
caps
.
InputReportByteLength
*
rawinput
->
data
.
hid
.
dwCount
]),
"got header.dwSize %lu
\n
"
,
rawinput
->
header
.
dwSize
);
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
rawinput
->
header
.
hDevice
!=
0
,
"got hDevice %p
\n
"
,
rawinput
->
header
.
hDevice
);
ok
(
rawinput
->
header
.
wParam
==
0
,
"got wParam %#Ix
\n
"
,
rawinput
->
header
.
wParam
);
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
rawinput
->
data
.
hid
.
dwSizeHid
==
desc
.
caps
.
InputReportByteLength
,
"got dwSizeHid %lu
\n
"
,
rawinput
->
data
.
hid
.
dwSizeHid
);
todo_wine
todo_wine
_if
(
params
->
input
)
ok
(
rawinput
->
data
.
hid
.
dwCount
>=
1
,
"got dwCount %lu
\n
"
,
rawinput
->
data
.
hid
.
dwCount
);
...
...
@@ -5864,28 +5864,23 @@ static void test_rawinput_desktop( const char *path, BOOL input )
res
=
msg_wait_for_events
(
1
,
&
rawinput_event
,
100
);
if
(
input
)
{
todo_wine
ok
(
res
==
0
,
"WaitForSingleObject returned %#lx
\n
"
,
res
);
todo_wine
ok
(
rawinput_calls
==
1
,
"got %u WM_INPUT messages
\n
"
,
rawinput_calls
);
rawinput
=
(
RAWINPUT
*
)
rawbuffer
;
todo_wine
ok
(
rawinput
->
header
.
dwType
==
RIM_TYPEHID
,
"got dwType %lu
\n
"
,
rawinput
->
header
.
dwType
);
todo_wine
ok
(
rawinput
->
header
.
dwSize
==
offsetof
(
RAWINPUT
,
data
.
hid
.
bRawData
[
desc
.
caps
.
InputReportByteLength
*
rawinput
->
data
.
hid
.
dwCount
]),
"got header.dwSize %lu
\n
"
,
rawinput
->
header
.
dwSize
);
todo_wine
ok
(
rawinput
->
header
.
hDevice
!=
0
,
"got hDevice %p
\n
"
,
rawinput
->
header
.
hDevice
);
ok
(
rawinput
->
header
.
wParam
==
0
,
"got wParam %#Ix
\n
"
,
rawinput
->
header
.
wParam
);
todo_wine
ok
(
rawinput
->
data
.
hid
.
dwSizeHid
==
desc
.
caps
.
InputReportByteLength
,
"got dwSizeHid %lu
\n
"
,
rawinput
->
data
.
hid
.
dwSizeHid
);
todo_wine
ok
(
rawinput
->
data
.
hid
.
dwCount
>=
1
,
"got dwCount %lu
\n
"
,
rawinput
->
data
.
hid
.
dwCount
);
}
else
{
todo_wine
ok
(
res
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %#lx
\n
"
,
res
);
todo_wine
ok
(
rawinput_calls
==
0
,
"got %u WM_INPUT messages
\n
"
,
rawinput_calls
);
}
...
...
dlls/user32/tests/input.c
View file @
74bf784b
...
...
@@ -3855,19 +3855,19 @@ static void test_SendInput_mouse_messages(void)
ok_ne
(
NULL
,
thread
,
HANDLE
,
"%p"
);
ok_ret
(
0
,
WaitForSingleObject
(
params
.
start_event
,
5000
)
);
todo_wine
ok_ret
(
1
,
AttachThreadInput
(
thread_id
,
GetCurrentThreadId
(),
TRUE
)
);
ok_ret
(
1
,
AttachThreadInput
(
thread_id
,
GetCurrentThreadId
(),
TRUE
)
);
ok_ret
(
0
,
SendMessageW
(
params
.
hwnd
,
WM_USER
,
0
,
0
)
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
wait_messages
(
5
,
FALSE
);
button_down_hwnd
[
1
].
message
.
hwnd
=
hwnd
;
ok_seq
(
button_down_hwnd
);
button_down_hwnd
_todo
[
1
].
message
.
hwnd
=
hwnd
;
ok_seq
(
button_down_hwnd
_todo
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
wait_messages
(
5
,
FALSE
);
button_up_hwnd
[
1
].
message
.
hwnd
=
hwnd
;
ok_seq
(
button_up_hwnd
);
todo_wine
ok_ret
(
1
,
AttachThreadInput
(
thread_id
,
GetCurrentThreadId
(),
FALSE
)
);
ok_ret
(
1
,
AttachThreadInput
(
thread_id
,
GetCurrentThreadId
(),
FALSE
)
);
ok_ret
(
1
,
SetEvent
(
params
.
end_event
)
);
ok_ret
(
0
,
WaitForSingleObject
(
thread
,
5000
)
);
ok_ret
(
1
,
CloseHandle
(
thread
)
);
...
...
server/process.c
View file @
74bf784b
...
...
@@ -1133,7 +1133,7 @@ DECL_HANDLER(new_process)
{
struct
startup_info
*
info
;
const
void
*
info_ptr
;
struct
unicode_str
name
;
struct
unicode_str
name
,
desktop_path
=
{
0
}
;
const
struct
security_descriptor
*
sd
;
const
struct
object_attributes
*
objattr
=
get_req_object_attributes
(
&
sd
,
&
name
,
NULL
);
struct
process
*
process
=
NULL
;
...
...
@@ -1276,7 +1276,9 @@ DECL_HANDLER(new_process)
FIXUP_LEN
(
info
->
data
->
imagepath_len
);
FIXUP_LEN
(
info
->
data
->
cmdline_len
);
FIXUP_LEN
(
info
->
data
->
title_len
);
desktop_path
.
str
=
(
WCHAR
*
)((
char
*
)
info
->
data
+
pos
);
FIXUP_LEN
(
info
->
data
->
desktop_len
);
desktop_path
.
len
=
info
->
data
->
desktop_len
;
FIXUP_LEN
(
info
->
data
->
shellinfo_len
);
FIXUP_LEN
(
info
->
data
->
runtime_len
);
#undef FIXUP_LEN
...
...
@@ -1327,7 +1329,7 @@ DECL_HANDLER(new_process)
}
/* connect to the window station */
connect_process_winstation
(
process
,
parent_thread
,
parent
);
connect_process_winstation
(
process
,
&
desktop_path
,
parent_thread
,
parent
);
/* inherit the process console, but keep pseudo handles (< 0), and 0 (= not attached to a console) as is */
if
((
int
)
info
->
data
->
console
>
0
)
...
...
server/user.h
View file @
74bf784b
...
...
@@ -22,6 +22,7 @@
#define __WINE_SERVER_USER_H
#include "wine/server_protocol.h"
#include "unicode.h"
struct
thread
;
struct
region
;
...
...
@@ -186,8 +187,8 @@ extern client_ptr_t get_class_client_ptr( struct window_class *class );
extern
struct
desktop
*
get_desktop_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
);
extern
struct
winstation
*
get_process_winstation
(
struct
process
*
process
,
unsigned
int
access
);
extern
struct
desktop
*
get_thread_desktop
(
struct
thread
*
thread
,
unsigned
int
access
);
extern
void
connect_process_winstation
(
struct
process
*
process
,
struct
thread
*
parent_thread
,
struct
process
*
parent_process
);
extern
void
connect_process_winstation
(
struct
process
*
process
,
struct
unicode_str
*
desktop_path
,
struct
thread
*
parent_thread
,
struct
process
*
parent_process
);
extern
void
set_process_default_desktop
(
struct
process
*
process
,
struct
desktop
*
desktop
,
obj_handle_t
handle
);
extern
void
close_process_desktop
(
struct
process
*
process
);
...
...
server/winstation.c
View file @
74bf784b
...
...
@@ -373,18 +373,37 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt
}
/* connect a process to its window station */
void
connect_process_winstation
(
struct
process
*
process
,
struct
thread
*
parent_thread
,
struct
process
*
parent_process
)
void
connect_process_winstation
(
struct
process
*
process
,
struct
unicode_str
*
desktop_path
,
struct
thread
*
parent_thread
,
struct
process
*
parent_process
)
{
struct
unicode_str
desktop_name
=
*
desktop_path
,
winstation_name
=
{
0
};
const
int
attributes
=
OBJ_CASE_INSENSITIVE
|
OBJ_OPENIF
;
struct
winstation
*
winstation
=
NULL
;
struct
desktop
*
desktop
=
NULL
;
const
WCHAR
*
wch
,
*
end
;
obj_handle_t
handle
;
for
(
wch
=
desktop_name
.
str
,
end
=
wch
+
desktop_name
.
len
/
sizeof
(
WCHAR
);
wch
!=
end
;
wch
++
)
{
if
(
*
wch
==
'\\'
)
{
winstation_name
.
str
=
desktop_name
.
str
;
winstation_name
.
len
=
(
wch
-
winstation_name
.
str
)
*
sizeof
(
WCHAR
);
desktop_name
.
str
=
wch
+
1
;
desktop_name
.
len
=
(
end
-
desktop_name
.
str
)
*
sizeof
(
WCHAR
);
break
;
}
}
/* check for an inherited winstation handle (don't ask...) */
if
((
handle
=
find_inherited_handle
(
process
,
&
winstation_ops
)))
{
winstation
=
(
struct
winstation
*
)
get_handle_obj
(
process
,
handle
,
0
,
&
winstation_ops
);
}
else
if
(
winstation_name
.
len
&&
(
winstation
=
open_named_object
(
NULL
,
&
winstation_ops
,
&
winstation_name
,
attributes
)))
{
handle
=
alloc_handle
(
process
,
winstation
,
STANDARD_RIGHTS_REQUIRED
|
WINSTA_ALL_ACCESS
,
0
);
}
else
if
(
parent_process
->
winstation
)
{
handle
=
duplicate_handle
(
parent_process
,
parent_process
->
winstation
,
...
...
@@ -399,6 +418,10 @@ void connect_process_winstation( struct process *process, struct thread *parent_
desktop
=
get_desktop_obj
(
process
,
handle
,
0
);
if
(
!
desktop
||
desktop
->
winstation
!=
winstation
)
goto
done
;
}
else
if
(
desktop_name
.
len
&&
(
desktop
=
open_named_object
(
&
winstation
->
obj
,
&
desktop_ops
,
&
desktop_name
,
attributes
)))
{
handle
=
alloc_handle
(
process
,
desktop
,
STANDARD_RIGHTS_REQUIRED
|
DESKTOP_ALL_ACCESS
,
0
);
}
else
{
if
(
parent_thread
&&
parent_thread
->
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