https://bugs.winehq.org/show_bug.cgi?id=56362
Bug ID: 56362 Summary: Using CreateRemoteThread on x86 child from an x86_64 parent fails if a lpParameter is specified. Product: Wine Version: 9.3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: admin@sewer56.dev Distribution: ---
Created attachment 76098 --> https://bugs.winehq.org/attachment.cgi?id=76098 Reproduction source code.
[ testcase source download ]
Using CreateRemoteThread on x86 child from an x86_64 parent fails if a lpParameter is specified.
Full code reproduction in attachment.
----------- Attachment Info:
test-AMD64.sh : Build & test 64-bit host and 64-bit client test-x86.sh : Build & test 32-bit host and 32-bit client test-AMD64-to-x86-target.sh : Build & test 64-bit host and 32-bit client
test_target.c : Dummy program, does nothing except sleep. call-into-suspended-process.c : Test program that simulates calling CreateRemoteThread into suspended processes.
-----------
Truth table:
| x86 to x86 | AMD64 | AMD64 w/ x86 test_target | Windows 11 | OK | OK | OK | Wine (git) | OK | OK | FAIL |
The test program fails with:
`[FAIL] CreateRemoteThread(process = 0000000000000048, start_address = 0000000000350000, parameter = &dummy) = 0000000000000000`.
----------- Extra Notes:
Tested on x86_64 Archlinux using latest git version of Wine (reports as 'wine-9.3').
When running on Windows, this succeeds `WriteProcessMemory succeeded, but 0 bytes were written`.
I encountered this bug while writing a DLL Injection library. I validate my code against Wine when I publish my libraries.
Please note, that I don't normally program in C (I don't even have an IDE set up for this). I just write minimal reproductions in C when filing bugs to try make life easier for Wine developers.