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
2020541b
Commit
2020541b
authored
Jul 07, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Avoid window activation race conditions with Wine.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53240
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
d83fcafc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
25 deletions
+15
-25
device8.c
dlls/dinput/tests/device8.c
+15
-25
No files found.
dlls/dinput/tests/device8.c
View file @
2020541b
...
@@ -1893,7 +1893,6 @@ static void test_sys_mouse( DWORD version )
...
@@ -1893,7 +1893,6 @@ static void test_sys_mouse( DWORD version )
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_POPUP
|
WS_VISIBLE
,
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_POPUP
|
WS_VISIBLE
,
50
,
50
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
50
,
50
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
ok
(
!!
hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
flush_events
();
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
NULL
,
DISCL_FOREGROUND
);
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
NULL
,
DISCL_FOREGROUND
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
...
@@ -1926,7 +1925,6 @@ static void test_sys_mouse( DWORD version )
...
@@ -1926,7 +1925,6 @@ static void test_sys_mouse( DWORD version )
child
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_CHILD
|
WS_VISIBLE
,
child
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_CHILD
|
WS_VISIBLE
,
10
,
10
,
50
,
50
,
hwnd
,
NULL
,
NULL
,
NULL
);
10
,
10
,
50
,
50
,
hwnd
,
NULL
,
NULL
,
NULL
);
ok
(
!!
child
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
ok
(
!!
child
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
flush_events
();
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
child
,
DISCL_FOREGROUND
);
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
child
,
DISCL_FOREGROUND
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
...
@@ -1966,27 +1964,6 @@ static void test_sys_mouse( DWORD version )
...
@@ -1966,27 +1964,6 @@ static void test_sys_mouse( DWORD version )
hr
=
IDirectInputDevice8_Acquire
(
device
);
hr
=
IDirectInputDevice8_Acquire
(
device
);
ok
(
hr
==
DI_NOEFFECT
,
"Acquire returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DI_NOEFFECT
,
"Acquire returned %#lx
\n
"
,
hr
);
tmp_hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_POPUP
|
WS_VISIBLE
,
50
,
250
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
tmp_hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
flush_events
();
hr
=
IDirectInputDevice8_GetDeviceState
(
device
,
sizeof
(
state
),
&
state
);
ok
(
hr
==
DIERR_NOTACQUIRED
,
"GetDeviceState returned %#lx
\n
"
,
hr
);
hr
=
IDirectInputDevice8_Acquire
(
device
);
ok
(
hr
==
DIERR_OTHERAPPHASPRIO
,
"Acquire returned %#lx
\n
"
,
hr
);
SetActiveWindow
(
hwnd
);
flush_events
();
hr
=
IDirectInputDevice8_SetProperty
(
device
,
DIPROP_BUFFERSIZE
,
(
LPCDIPROPHEADER
)
&
prop_dword
);
ok
(
hr
==
DI_OK
,
"SetProperty returned %#lx
\n
"
,
hr
);
hr
=
IDirectInputDevice8_Acquire
(
device
);
ok
(
hr
==
DI_OK
,
"Acquire returned %#lx
\n
"
,
hr
);
mouse_event
(
MOUSEEVENTF_MOVE
,
10
,
10
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_MOVE
,
10
,
10
,
0
,
0
);
res
=
WaitForSingleObject
(
event
,
100
);
res
=
WaitForSingleObject
(
event
,
100
);
if
(
res
==
WAIT_TIMEOUT
)
/* Acquire is asynchronous */
if
(
res
==
WAIT_TIMEOUT
)
/* Acquire is asynchronous */
...
@@ -2058,8 +2035,23 @@ static void test_sys_mouse( DWORD version )
...
@@ -2058,8 +2035,23 @@ static void test_sys_mouse( DWORD version )
ok
(
hr
==
DI_OK
,
"GetDeviceData returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DI_OK
,
"GetDeviceData returned %#lx
\n
"
,
hr
);
ok
(
count
==
1
,
"got count %lu
\n
"
,
count
);
ok
(
count
==
1
,
"got count %lu
\n
"
,
count
);
hr
=
IDirectInputDevice8_Unacquire
(
device
);
ok
(
hr
==
DI_OK
,
"Unacquire returned %#lx
\n
"
,
hr
);
tmp_hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_POPUP
|
WS_VISIBLE
,
50
,
250
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
tmp_hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
hr
=
IDirectInputDevice8_GetDeviceState
(
device
,
sizeof
(
state
),
&
state
);
ok
(
hr
==
DIERR_NOTACQUIRED
,
"GetDeviceState returned %#lx
\n
"
,
hr
);
hr
=
IDirectInputDevice8_Acquire
(
device
);
ok
(
hr
==
DIERR_OTHERAPPHASPRIO
,
"Acquire returned %#lx
\n
"
,
hr
);
DestroyWindow
(
tmp_hwnd
);
DestroyWindow
(
tmp_hwnd
);
CloseHandle
(
event
);
CloseHandle
(
event
);
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
...
@@ -2554,7 +2546,6 @@ static void test_sys_keyboard( DWORD version )
...
@@ -2554,7 +2546,6 @@ static void test_sys_keyboard( DWORD version )
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_POPUP
|
WS_VISIBLE
,
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_POPUP
|
WS_VISIBLE
,
50
,
50
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
50
,
50
,
200
,
200
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
ok
(
!!
hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
flush_events
();
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
NULL
,
DISCL_FOREGROUND
);
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
NULL
,
DISCL_FOREGROUND
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
...
@@ -2589,7 +2580,6 @@ static void test_sys_keyboard( DWORD version )
...
@@ -2589,7 +2580,6 @@ static void test_sys_keyboard( DWORD version )
child
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_CHILD
|
WS_VISIBLE
,
child
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_CHILD
|
WS_VISIBLE
,
10
,
10
,
50
,
50
,
hwnd
,
NULL
,
NULL
,
NULL
);
10
,
10
,
50
,
50
,
hwnd
,
NULL
,
NULL
,
NULL
);
ok
(
!!
child
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
ok
(
!!
child
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
flush_events
();
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
child
,
DISCL_FOREGROUND
);
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
child
,
DISCL_FOREGROUND
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"SetCooperativeLevel returned %#lx
\n
"
,
hr
);
...
...
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