[PATCH 0/3] winepulse: Add Wow64 handlers.
Since the wineoss queue has stalled for today, I thought I'd send in the Wow64 handlers for winepulse. The first two patches can be tested with a regular setup. The third requires enabling the new Wow64 mode (see the patch below). With that applied you build and install 32-bit and 64-bit versions of Wine and then run a 32-bit app with wine64. There's obviously no graphics at this point, but the 32-bit mmdevapi tests run well. Huw D. M. Davies (3): winepulse: Use handles to represent the stream. winepulse: Return offsets rather than ptrs to the strings. winepulse: Implement Wow64 entry points in the Unix library. dlls/winepulse.drv/mmdevdrv.c | 17 +- dlls/winepulse.drv/pulse.c | 522 ++++++++++++++++++++++++++++++++-- dlls/winepulse.drv/unixlib.h | 44 ++- 3 files changed, 524 insertions(+), 59 deletions(-) -- diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index d750f7a7579..b18f1c7fba9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1548,8 +1548,8 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved if (wm->ldr.Flags & LDR_DONT_RESOLVE_REFS) return STATUS_SUCCESS; if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, reason ); - if (wm->ldr.Flags & LDR_WINE_INTERNAL && reason == DLL_PROCESS_ATTACH) - unix_funcs->init_builtin_dll( wm->ldr.DllBase ); +// if (wm->ldr.Flags & LDR_WINE_INTERNAL && reason == DLL_PROCESS_ATTACH) +// unix_funcs->init_builtin_dll( wm->ldr.DllBase ); if (!entry) return STATUS_SUCCESS; if (TRACE_ON(relay)) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index ee958ae71f4..2bb5e8bbf83 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1919,7 +1919,7 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module ) if (!status) { if (main_image_info.ImageCharacteristics & IMAGE_FILE_DLL) status = STATUS_INVALID_IMAGE_FORMAT; - if (main_image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT; +// if (main_image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT; } if (status) /* try launching it through start.exe */
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112549 Your paranoid android. === debian11 (build log) === WineRunWineTest.pl:error: The task timed out
Huw, thanks for sharing... two questions though: 1) I feel like it's a bit fragile to have the 32 bit and 64 bit syscall structures defined in several places, without any rule about synchronizing them. Is there any plan around this ? (IMO with a bit of additional info in .h file (like in / out / in-out for each type) the generation of the 32 bit => 64 bit thunking .c code could be automated 2) how will the new wow64 be activated? - One patch to migrate all DLLs at once ? but this likely requires all DLLs to migrated to PE+ Unixlib before - On a per DLL basis ? - other ? A+
Eric Pouech <eric.pouech(a)orange.fr> writes:
1) I feel like it's a bit fragile to have the 32 bit and 64 bit syscall structures defined in several places, without any rule about synchronizing them.
Is there any plan around this ? (IMO with a bit of additional info in .h file (like in / out / in-out for each type) the generation of the 32 bit => 64 bit thunking .c code could be automated
That's a possibility, but it's not clear that it's worth the trouble. There aren't that many libraries that need such thunks.
2) how will the new wow64 be activated?
- One patch to migrate all DLLs at once ? but this likely requires all DLLs to migrated to PE+ Unixlib before
- On a per DLL basis ?
It's process-global, so it requires all DLLs to be converted to PE first. There's no possible way to enable this only for some DLLs. -- Alexandre Julliard julliard(a)winehq.org
2) how will the new wow64 be activated?
- One patch to migrate all DLLs at once ? but this likely requires all DLLs to migrated to PE+ Unixlib before
- On a per DLL basis ? It's process-global, so it requires all DLLs to be converted to PE first. There's no possible way to enable this only for some DLLs.
thx trying to look forward: - no impact (for now) on configuration & compilation: 32 bit foo.so will continue to be built if corresponding host support is present (so still requiring two trees for 64 and 32 bit compilation) (no need to change that) - granularity of process: any idea on how it'll be turned on or off per process?
I don't really feel comfortable reviewing these. To me, they make the code strictly worse, and I don't understand the wow64 stuff to know if this is the best we can do. Andrew On Thu, Apr 14, 2022 at 10:03:08AM +0100, Huw Davies wrote:
Since the wineoss queue has stalled for today, I thought I'd send in the Wow64 handlers for winepulse.
The first two patches can be tested with a regular setup. The third requires enabling the new Wow64 mode (see the patch below). With that applied you build and install 32-bit and 64-bit versions of Wine and then run a 32-bit app with wine64. There's obviously no graphics at this point, but the 32-bit mmdevapi tests run well.
Huw D. M. Davies (3): winepulse: Use handles to represent the stream. winepulse: Return offsets rather than ptrs to the strings. winepulse: Implement Wow64 entry points in the Unix library.
dlls/winepulse.drv/mmdevdrv.c | 17 +- dlls/winepulse.drv/pulse.c | 522 ++++++++++++++++++++++++++++++++-- dlls/winepulse.drv/unixlib.h | 44 ++- 3 files changed, 524 insertions(+), 59 deletions(-) -- diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index d750f7a7579..b18f1c7fba9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1548,8 +1548,8 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
if (wm->ldr.Flags & LDR_DONT_RESOLVE_REFS) return STATUS_SUCCESS; if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, reason ); - if (wm->ldr.Flags & LDR_WINE_INTERNAL && reason == DLL_PROCESS_ATTACH) - unix_funcs->init_builtin_dll( wm->ldr.DllBase ); +// if (wm->ldr.Flags & LDR_WINE_INTERNAL && reason == DLL_PROCESS_ATTACH) +// unix_funcs->init_builtin_dll( wm->ldr.DllBase ); if (!entry) return STATUS_SUCCESS;
if (TRACE_ON(relay)) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index ee958ae71f4..2bb5e8bbf83 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1919,7 +1919,7 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module ) if (!status) { if (main_image_info.ImageCharacteristics & IMAGE_FILE_DLL) status = STATUS_INVALID_IMAGE_FORMAT; - if (main_image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT; +// if (main_image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT; }
if (status) /* try launching it through start.exe */
participants (5)
-
Alexandre Julliard -
Andrew Eikum -
Eric Pouech -
Huw Davies -
Marvin