freebsd-ports/emulators/wine8/files/patch-dlls_ntdll_unix_loader.c
Gerald Pfeifer 5aa9792e66 emulators/wine8: New port, cloning emulators/wine
Wine 9 has been released some weeks ago and it's time to upgrade the
main emulators/wine port. However, there may be some regressions (in
particular around WoW64), so create emulators/wine8 as a clone of the
state before the version upgrade as a fallback. [1]

Since it is rarely, if ever, used, in particular in this context,
remove the MONO option.

Discussed with:	Lexi Winter <lexi@le-fay.org> [1]
2024-03-03 14:00:33 +00:00

24 lines
908 B
C

--- dlls/ntdll/unix/loader.c.orig 2023-07-19 15:29:22 UTC
+++ dlls/ntdll/unix/loader.c
@@ -694,6 +694,21 @@ static NTSTATUS loader_exec( char **argv, WORD machine
{
if (machine != current_machine)
{
+ char* wineserver_path = getenv("WINESERVER");
+ if (wineserver_path != NULL && wineserver_path[0] == '/') {
+ char* s = remove_tail(wineserver_path, "server");
+ if (s != NULL) {
+ if (machine == IMAGE_FILE_MACHINE_AMD64) {
+ argv[1] = malloc(strlen(s) + 3);
+ strcpy(argv[1], s);
+ strcat(argv[1], "64");
+ } else {
+ argv[1] = s;
+ }
+ preloader_exec(argv);
+ }
+ }
+
if (machine == IMAGE_FILE_MACHINE_AMD64) /* try the 64-bit loader */
{
size_t len = strlen(wineloader);