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
5ca22f55
Commit
5ca22f55
authored
Jan 13, 2023
by
Tim Clem
Committed by
Alexandre Julliard
Jan 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Correct GetRawInputBuffer alignment under WoW64.
Patch originally by Rémi Bernon.
parent
fb0f8fe5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
input.c
dlls/user32/tests/input.c
+0
-1
rawinput.c
dlls/win32u/rawinput.c
+11
-1
No files found.
dlls/user32/tests/input.c
View file @
5ca22f55
...
...
@@ -2454,7 +2454,6 @@ static void test_GetRawInputBuffer(void)
ok
(
size
==
sizeof
(
buffer
),
"GetRawInputBuffer returned unexpected size: %u
\n
"
,
size
);
ok
(
HEADER_FIELD
(
dwType
)
==
RIM_TYPEKEYBOARD
,
"Unexpected rawinput dwType: %ld
\n
"
,
HEADER_FIELD
(
dwType
));
todo_wine_if
(
is_wow64
)
ok
(
HEADER_FIELD
(
wParam
)
==
0
||
HEADER_FIELD
(
wParam
)
==
1
,
"Expected wparam 0 or 1, got %Iu
\n
"
,
(
WPARAM
)
HEADER_FIELD
(
wParam
));
scan_code
=
is_wow64
?
((
RAWINPUT64
*
)
buffer
)
->
data
.
keyboard
.
MakeCode
:
((
RAWINPUT
*
)
buffer
)
->
data
.
keyboard
.
MakeCode
;
ok
(
scan_code
==
0x2d
,
"Unexpected rawinput keyboard scan code: %x
\n
"
,
scan_code
);
...
...
dlls/win32u/rawinput.c
View file @
5ca22f55
...
...
@@ -671,10 +671,20 @@ UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT heade
if
(
!
rawinput_from_hardware_message
(
data
,
msg_data
))
break
;
if
(
overhead
)
{
/* Under WoW64, GetRawInputBuffer always gives 64-bit RAWINPUT structs. */
RAWINPUT64
*
ri64
=
(
RAWINPUT64
*
)
data
;
memmove
(
(
char
*
)
&
data
->
data
+
overhead
,
&
data
->
data
,
data
->
header
.
dwSize
-
sizeof
(
RAWINPUTHEADER
)
);
ri64
->
header
.
dwSize
+=
overhead
;
/* Need to copy wParam before hDevice so it's not overwritten. */
ri64
->
header
.
wParam
=
data
->
header
.
wParam
;
#ifdef _WIN64
ri64
->
header
.
hDevice
=
data
->
header
.
hDevice
;
#else
ri64
->
header
.
hDevice
=
HandleToULong
(
data
->
header
.
hDevice
);
#endif
}
data
->
header
.
dwSize
+=
overhead
;
remaining
-=
data
->
header
.
dwSize
;
data
=
NEXTRAWINPUTBLOCK
(
data
);
msg_data
=
(
struct
hardware_msg_data
*
)((
char
*
)
msg_data
+
msg_data
->
size
);
...
...
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