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
9a9a1656
Commit
9a9a1656
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: Start and cancel reading HID reports while holding the CS.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a382646e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
joystick_hid.c
dlls/dinput/joystick_hid.c
+20
-12
No files found.
dlls/dinput/joystick_hid.c
View file @
9a9a1656
...
...
@@ -699,14 +699,18 @@ static HRESULT WINAPI hid_joystick_Acquire( IDirectInputDevice8W *iface )
TRACE
(
"iface %p.
\n
"
,
iface
);
if
((
hr
=
IDirectInputDevice2WImpl_Acquire
(
iface
))
!=
DI_OK
)
return
hr
;
memset
(
&
impl
->
read_ovl
,
0
,
sizeof
(
impl
->
read_ovl
)
);
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
);
EnterCriticalSection
(
&
impl
->
base
.
crit
);
hr
=
IDirectInputDevice2WImpl_Acquire
(
iface
);
if
(
hr
==
DI_OK
)
{
memset
(
&
impl
->
read_ovl
,
0
,
sizeof
(
impl
->
read_ovl
)
);
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
);
}
LeaveCriticalSection
(
&
impl
->
base
.
crit
);
return
DI_OK
;
return
hr
;
}
static
HRESULT
WINAPI
hid_joystick_Unacquire
(
IDirectInputDevice8W
*
iface
)
...
...
@@ -717,12 +721,16 @@ static HRESULT WINAPI hid_joystick_Unacquire( IDirectInputDevice8W *iface )
TRACE
(
"iface %p.
\n
"
,
iface
);
if
((
hr
=
IDirectInputDevice2WImpl_Unacquire
(
iface
))
!=
DI_OK
)
return
hr
;
ret
=
CancelIoEx
(
impl
->
device
,
&
impl
->
read_ovl
);
if
(
!
ret
)
WARN
(
"CancelIoEx failed, last error %u
\n
"
,
GetLastError
()
);
EnterCriticalSection
(
&
impl
->
base
.
crit
);
if
(
impl
->
base
.
acquired
)
{
ret
=
CancelIoEx
(
impl
->
device
,
&
impl
->
read_ovl
);
if
(
!
ret
)
WARN
(
"CancelIoEx failed, last error %u
\n
"
,
GetLastError
()
);
}
hr
=
IDirectInputDevice2WImpl_Unacquire
(
iface
);
LeaveCriticalSection
(
&
impl
->
base
.
crit
);
return
DI_OK
;
return
hr
;
}
static
HRESULT
WINAPI
hid_joystick_GetDeviceState
(
IDirectInputDevice8W
*
iface
,
DWORD
len
,
void
*
ptr
)
...
...
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