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
f333f4cd
Commit
f333f4cd
authored
Jan 05, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use find_device_from_handle in process_rawinput_message.
And only refresh the list if the device handle isn't known.
parent
f0e02e4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
rawinput.c
dlls/win32u/rawinput.c
+16
-3
No files found.
dlls/win32u/rawinput.c
View file @
f333f4cd
...
@@ -301,12 +301,13 @@ static void rawinput_update_device_list(void)
...
@@ -301,12 +301,13 @@ static void rawinput_update_device_list(void)
enumerate_devices
(
RIM_TYPEHID
,
guid_devinterface_hidW
);
enumerate_devices
(
RIM_TYPEHID
,
guid_devinterface_hidW
);
}
}
static
struct
device
*
find_device_from_handle
(
HANDLE
handle
)
static
struct
device
*
find_device_from_handle
(
HANDLE
handle
,
BOOL
refresh
)
{
{
struct
device
*
device
;
struct
device
*
device
;
LIST_FOR_EACH_ENTRY
(
device
,
&
devices
,
struct
device
,
entry
)
LIST_FOR_EACH_ENTRY
(
device
,
&
devices
,
struct
device
,
entry
)
if
(
device
->
handle
==
handle
)
return
device
;
if
(
device
->
handle
==
handle
)
return
device
;
if
(
!
refresh
)
return
NULL
;
rawinput_update_device_list
();
rawinput_update_device_list
();
...
@@ -399,7 +400,7 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data
...
@@ -399,7 +400,7 @@ UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data
pthread_mutex_lock
(
&
rawinput_mutex
);
pthread_mutex_lock
(
&
rawinput_mutex
);
if
(
!
(
device
=
find_device_from_handle
(
handle
)))
if
(
!
(
device
=
find_device_from_handle
(
handle
,
TRUE
)))
{
{
pthread_mutex_unlock
(
&
rawinput_mutex
);
pthread_mutex_unlock
(
&
rawinput_mutex
);
RtlSetLastWin32Error
(
ERROR_INVALID_HANDLE
);
RtlSetLastWin32Error
(
ERROR_INVALID_HANDLE
);
...
@@ -568,8 +569,20 @@ BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_d
...
@@ -568,8 +569,20 @@ BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_d
if
(
msg
->
message
==
WM_INPUT_DEVICE_CHANGE
)
if
(
msg
->
message
==
WM_INPUT_DEVICE_CHANGE
)
{
{
BOOL
refresh
=
msg
->
wParam
==
GIDC_ARRIVAL
;
struct
device
*
device
;
pthread_mutex_lock
(
&
rawinput_mutex
);
pthread_mutex_lock
(
&
rawinput_mutex
);
rawinput_update_device_list
();
if
((
device
=
find_device_from_handle
(
UlongToHandle
(
msg_data
->
rawinput
.
device
),
refresh
)))
{
if
(
msg
->
wParam
==
GIDC_REMOVAL
)
{
list_remove
(
&
device
->
entry
);
NtClose
(
device
->
file
);
free
(
device
->
data
);
free
(
device
);
}
}
pthread_mutex_unlock
(
&
rawinput_mutex
);
pthread_mutex_unlock
(
&
rawinput_mutex
);
}
}
else
else
...
...
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