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
721437b4
Commit
721437b4
authored
Jan 22, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Update the device status while holding its CS.
parent
6122dddf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
dinput_main.c
dlls/dinput/dinput_main.c
+7
-8
No files found.
dlls/dinput/dinput_main.c
View file @
721437b4
...
...
@@ -107,7 +107,7 @@ void dinput_hooks_unacquire_device( IDirectInputDevice8W *iface )
LeaveCriticalSection
(
&
dinput_hook_crit
);
}
static
void
dinput_device_internal_unacquire
(
IDirectInputDevice8W
*
iface
)
static
void
dinput_device_internal_unacquire
(
IDirectInputDevice8W
*
iface
,
DWORD
status
)
{
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
...
...
@@ -117,7 +117,7 @@ static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface )
if
(
impl
->
status
==
STATUS_ACQUIRED
)
{
impl
->
vtbl
->
unacquire
(
iface
);
impl
->
status
=
STATUS_UNACQUIRED
;
impl
->
status
=
status
;
list_remove
(
&
impl
->
entry
);
}
LeaveCriticalSection
(
&
impl
->
crit
);
...
...
@@ -211,7 +211,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
}
}
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_mouse_list
,
struct
dinput_device
,
entry
)
...
...
@@ -219,7 +219,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
}
}
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_rawmouse_list
,
struct
dinput_device
,
entry
)
...
...
@@ -227,7 +227,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
}
}
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_keyboard_list
,
struct
dinput_device
,
entry
)
...
...
@@ -235,7 +235,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
}
}
LeaveCriticalSection
(
&
dinput_hook_crit
);
...
...
@@ -301,9 +301,8 @@ static DWORD WINAPI dinput_thread_proc( void *params )
if
((
device
=
state
.
devices
[
ret
])
&&
FAILED
(
device
->
vtbl
->
read
(
&
device
->
IDirectInputDevice8W_iface
)
))
{
EnterCriticalSection
(
&
dinput_hook_crit
);
dinput_device_internal_unacquire
(
&
device
->
IDirectInputDevice8W_iface
);
dinput_device_internal_unacquire
(
&
device
->
IDirectInputDevice8W_iface
,
STATUS_UNPLUGGED
);
LeaveCriticalSection
(
&
dinput_hook_crit
);
device
->
status
=
STATUS_UNPLUGGED
;
state
.
events
[
ret
]
=
state
.
events
[
--
state
.
events_count
];
state
.
devices
[
ret
]
=
state
.
devices
[
state
.
events_count
];
...
...
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