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
82211cd4
Commit
82211cd4
authored
May 04, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Remove unnecessary MOUSE / KEYBOARD special cases.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6a0eb7a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
37 deletions
+5
-37
rawinput.c
dlls/user32/rawinput.c
+4
-35
input.c
dlls/user32/tests/input.c
+1
-2
No files found.
dlls/user32/rawinput.c
View file @
82211cd4
...
...
@@ -684,10 +684,6 @@ UINT WINAPI GetRawInputDeviceInfoA(HANDLE device, UINT command, void *data, UINT
*/
UINT
WINAPI
GetRawInputDeviceInfoW
(
HANDLE
handle
,
UINT
command
,
void
*
data
,
UINT
*
data_size
)
{
/* FIXME: Most of this is made up. */
static
const
RID_DEVICE_INFO_KEYBOARD
keyboard_info
=
{
0
,
0
,
1
,
12
,
3
,
101
};
static
const
RID_DEVICE_INFO_MOUSE
mouse_info
=
{
1
,
5
,
0
,
FALSE
};
RID_DEVICE_INFO
info
;
struct
device
*
device
;
const
void
*
to_copy
;
...
...
@@ -718,41 +714,15 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE handle, UINT command, void *data, UINT
case
RIDI_DEVICENAME
:
/* for RIDI_DEVICENAME, data_size is in characters, not bytes */
avail_bytes
=
*
data_size
*
sizeof
(
WCHAR
);
if
(
handle
==
WINE_MOUSE_HANDLE
)
{
*
data_size
=
ARRAY_SIZE
(
L"
\\\\
?
\\
WINE_MOUSE"
);
to_copy
=
L"
\\\\
?
\\
WINE_MOUSE"
;
}
else
if
(
handle
==
WINE_KEYBOARD_HANDLE
)
{
*
data_size
=
ARRAY_SIZE
(
L"
\\\\
?
\\
WINE_KEYBOARD"
);
to_copy
=
L"
\\\\
?
\\
WINE_KEYBOARD"
;
}
else
{
*
data_size
=
wcslen
(
device
->
detail
->
DevicePath
)
+
1
;
to_copy
=
device
->
detail
->
DevicePath
;
}
*
data_size
=
wcslen
(
device
->
detail
->
DevicePath
)
+
1
;
to_copy
=
device
->
detail
->
DevicePath
;
to_copy_bytes
=
*
data_size
*
sizeof
(
WCHAR
);
break
;
case
RIDI_DEVICEINFO
:
avail_bytes
=
*
data_size
;
info
.
cbSize
=
sizeof
(
info
);
if
(
handle
==
WINE_MOUSE_HANDLE
)
{
info
.
dwType
=
RIM_TYPEMOUSE
;
info
.
u
.
mouse
=
mouse_info
;
}
else
if
(
handle
==
WINE_KEYBOARD_HANDLE
)
{
info
.
dwType
=
RIM_TYPEKEYBOARD
;
info
.
u
.
keyboard
=
keyboard_info
;
}
else
{
info
=
device
->
info
;
}
info
=
device
->
info
;
to_copy_bytes
=
sizeof
(
info
);
*
data_size
=
to_copy_bytes
;
to_copy
=
&
info
;
...
...
@@ -760,8 +730,7 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE handle, UINT command, void *data, UINT
case
RIDI_PREPARSEDDATA
:
avail_bytes
=
*
data_size
;
if
(
handle
==
WINE_MOUSE_HANDLE
||
handle
==
WINE_KEYBOARD_HANDLE
||
device
->
info
.
dwType
!=
RIM_TYPEHID
)
if
(
device
->
info
.
dwType
!=
RIM_TYPEHID
)
{
to_copy_bytes
=
0
;
*
data_size
=
0
;
...
...
dlls/user32/tests/input.c
View file @
82211cd4
...
...
@@ -1923,8 +1923,7 @@ static void test_GetRawInputDeviceList(void)
* understand that; so use the \\?\ prefix instead */
name
[
1
]
=
'\\'
;
file
=
CreateFileW
(
name
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
todo_wine_if
(
info
.
dwType
==
RIM_TYPEMOUSE
||
info
.
dwType
==
RIM_TYPEKEYBOARD
)
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failed to open %s, error %u
\n
"
,
wine_dbgstr_w
(
name
),
GetLastError
());
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failed to open %s, error %u
\n
"
,
wine_dbgstr_w
(
name
),
GetLastError
());
sz
=
0
;
ret
=
pGetRawInputDeviceInfoW
(
devices
[
i
].
hDevice
,
RIDI_PREPARSEDDATA
,
NULL
,
&
sz
);
...
...
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