On Fri Jan 13 07:11:10 2023 +0000, Rémi Bernon wrote:
Are all these changes necessary? Why not simply fixup the existing fixup (which imho keeps this wow64 oddity localized and avoids having specific handling elsewhere where it's not needed) like this:
diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c index ab1252ccea6..f0be80924af 100644 --- a/dlls/win32u/rawinput.c +++ b/dlls/win32u/rawinput.c @@ -48,7 +48,11 @@ typedef struct { DWORD dwType; DWORD dwSize; - ULONGLONG hDevice; + union + { + HANDLE hDevice; + ULONGLONG __align; + }; ULONGLONG wParam; } RAWINPUTHEADER64; @@ -671,10 +675,14 @@ 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; + ri64->header.hDevice = data->header.hDevice; + ri64->header.wParam = data->header.wParam; } - data->header.dwSize += overhead; remaining -= data->header.dwSize; data = NEXTRAWINPUTBLOCK(data); msg_data = (struct hardware_msg_data *)((char *)msg_data + msg_data->size);
With a simple fix like that I think it'd even be acceptable to merge in 8.0.
(Well, I wanted to make it simpler, but I realize that __align high bits are left untouched here, probably better to keep the #ifdef and HandleToUlong)