Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
84e58612
Commit
84e58612
authored
Oct 01, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Send DISFFC_RESET command on HID joystick (Un)Acquire.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9a9a1656
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
joystick_hid.c
dlls/dinput/joystick_hid.c
+4
-0
hid.c
dlls/dinput8/tests/hid.c
+2
-10
No files found.
dlls/dinput/joystick_hid.c
View file @
84e58612
...
...
@@ -707,6 +707,8 @@ static HRESULT WINAPI hid_joystick_Acquire( IDirectInputDevice8W *iface )
impl
->
read_ovl
.
hEvent
=
impl
->
base
.
read_event
;
if
(
ReadFile
(
impl
->
device
,
impl
->
input_report_buf
,
report_len
,
NULL
,
&
impl
->
read_ovl
))
impl
->
base
.
read_callback
(
iface
);
IDirectInputDevice8_SendForceFeedbackCommand
(
iface
,
DISFFC_RESET
);
}
LeaveCriticalSection
(
&
impl
->
base
.
crit
);
...
...
@@ -726,6 +728,8 @@ static HRESULT WINAPI hid_joystick_Unacquire( IDirectInputDevice8W *iface )
{
ret
=
CancelIoEx
(
impl
->
device
,
&
impl
->
read_ovl
);
if
(
!
ret
)
WARN
(
"CancelIoEx failed, last error %u
\n
"
,
GetLastError
()
);
IDirectInputDevice8_SendForceFeedbackCommand
(
iface
,
DISFFC_RESET
);
}
hr
=
IDirectInputDevice2WImpl_Unacquire
(
iface
);
LeaveCriticalSection
(
&
impl
->
base
.
crit
);
...
...
dlls/dinput8/tests/hid.c
View file @
84e58612
...
...
@@ -5259,14 +5259,6 @@ static void test_force_feedback_joystick( void )
.
report_len
=
2
,
.
report_buf
=
{
1
,
0x01
},
};
struct
hid_expect
expect_dc_reset_todo
=
{
.
code
=
IOCTL_HID_WRITE_REPORT
,
.
todo
=
TRUE
,
.
report_id
=
1
,
.
report_len
=
2
,
.
report_buf
=
{
1
,
0x01
},
};
const
DIDEVICEINSTANCEW
expect_devinst
=
{
...
...
@@ -5775,7 +5767,7 @@ static void test_force_feedback_joystick( void )
hr
=
IDirectInputDevice8_SetCooperativeLevel
(
device
,
hwnd
,
DISCL_BACKGROUND
|
DISCL_EXCLUSIVE
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_SetCooperativeLevel returned: %#x
\n
"
,
hr
);
set_hid_expect
(
file
,
&
expect_dc_reset
_todo
,
sizeof
(
expect_dc_reset_todo
)
);
set_hid_expect
(
file
,
&
expect_dc_reset
,
sizeof
(
expect_dc_reset
)
);
hr
=
IDirectInputDevice8_Acquire
(
device
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_Acquire returned: %#x
\n
"
,
hr
);
set_hid_expect
(
file
,
NULL
,
0
);
...
...
@@ -5821,7 +5813,7 @@ static void test_force_feedback_joystick( void )
test_periodic_effect
(
device
,
file
);
set_hid_expect
(
file
,
&
expect_dc_reset
_todo
,
sizeof
(
expect_dc_reset_todo
)
);
set_hid_expect
(
file
,
&
expect_dc_reset
,
sizeof
(
expect_dc_reset
)
);
hr
=
IDirectInputDevice8_Unacquire
(
device
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_Unacquire returned: %#x
\n
"
,
hr
);
set_hid_expect
(
file
,
NULL
,
0
);
...
...
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