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
4ae893e2
Commit
4ae893e2
authored
May 02, 2024
by
Evan Tang
Committed by
Alexandre Julliard
May 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Post device arrival messages in NtUserRegisterRawInputDevices.
parent
a3134963
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
input.c
dlls/user32/tests/input.c
+2
-2
rawinput.c
dlls/win32u/rawinput.c
+27
-0
No files found.
dlls/user32/tests/input.c
View file @
4ae893e2
...
...
@@ -1880,7 +1880,7 @@ static void test_RegisterRawInputDevices(void)
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
}
todo_wine
ok
(
count
>=
2
,
"got %u messages
\n
"
,
count
);
ok
(
count
>=
2
,
"got %u messages
\n
"
,
count
);
count
=
0
;
ok_ret
(
1
,
RegisterRawInputDevices
(
raw_devices
,
ARRAY_SIZE
(
raw_devices
),
sizeof
(
RAWINPUTDEVICE
)
)
);
...
...
@@ -1890,7 +1890,7 @@ static void test_RegisterRawInputDevices(void)
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
}
todo_wine
ok
(
count
>=
2
,
"got %u messages
\n
"
,
count
);
ok
(
count
>=
2
,
"got %u messages
\n
"
,
count
);
/* RIDEV_REMOVE requires hwndTarget == NULL */
raw_devices
[
0
].
dwFlags
=
RIDEV_REMOVE
;
...
...
dlls/win32u/rawinput.c
View file @
4ae893e2
...
...
@@ -598,6 +598,30 @@ BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_d
return
TRUE
;
}
static
void
post_device_notifications
(
const
RAWINPUTDEVICE
*
filter
)
{
ULONG
usages
=
MAKELONG
(
filter
->
usUsagePage
,
filter
->
usUsage
);
struct
device
*
device
;
LIST_FOR_EACH_ENTRY
(
device
,
&
devices
,
struct
device
,
entry
)
{
switch
(
device
->
info
.
dwType
)
{
case
RIM_TYPEMOUSE
:
if
(
usages
!=
MAKELONG
(
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_MOUSE
))
continue
;
break
;
case
RIM_TYPEKEYBOARD
:
if
(
usages
!=
MAKELONG
(
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_KEYBOARD
))
continue
;
break
;
case
RIM_TYPEHID
:
if
(
usages
!=
MAKELONG
(
device
->
info
.
hid
.
usUsagePage
,
device
->
info
.
hid
.
usUsage
))
continue
;
break
;
}
NtUserPostMessage
(
filter
->
hwndTarget
,
WM_INPUT_DEVICE_CHANGE
,
GIDC_ARRIVAL
,
(
LPARAM
)
device
->
handle
);
}
}
static
void
register_rawinput_device
(
const
RAWINPUTDEVICE
*
device
)
{
RAWINPUTDEVICE
*
pos
,
*
end
;
...
...
@@ -619,6 +643,7 @@ static void register_rawinput_device( const RAWINPUTDEVICE *device )
}
else
{
if
((
device
->
dwFlags
&
RIDEV_DEVNOTIFY
)
&&
device
->
hwndTarget
)
post_device_notifications
(
device
);
if
(
pos
==
end
||
pos
->
usUsagePage
!=
device
->
usUsagePage
||
pos
->
usUsage
!=
device
->
usUsage
)
{
memmove
(
pos
+
1
,
pos
,
(
char
*
)
end
-
(
char
*
)
pos
);
...
...
@@ -684,6 +709,8 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d
return
FALSE
;
}
rawinput_update_device_list
(
TRUE
);
registered_devices
=
new_registered_devices
;
for
(
i
=
0
;
i
<
device_count
;
++
i
)
register_rawinput_device
(
devices
+
i
);
...
...
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