Calling UNIX code from PE binary

Questions about Wine on Linux
Locked
User avatar
silty
Newbie
Newbie
Posts: 1
Joined: Sun Jun 02, 2024 4:15 pm

Calling UNIX code from PE binary

Post by silty »

I'm working on a project that involves a .dll connecting to a pathname Unix Domain Socket, and seeing as MR2786 (Add support for AF_UNIX sockets) is still stuck in limbo, I've been looking into other ways of accomplishing this.

According to https://wiki.winehq.org/Wine_Features#A ... ortability, Wine "permits mixing of Win32 and POSIX code" and "permits mixing of ELF (.so) and PE (.dll/.exe) binaries in one address space", but I have been unable to find any clear documentation on how one might actually go about taking advantage of that. On latest Wine (9.9-2, Arch repos), simply calling LoadLibraryA() on a .so spits out

Code: Select all

0158:err:seh:NtRaiseException Unhandled exception code c0000409 flags 1 addr 0x7b9e94a5
, which leads me to believe that there's more that's required for Wine to do PE->ELF interop. While trying to figure out what exactly that might be, I came across https://www.winehq.org/pipermail/wine-d ... 13677.html, but later messages in the thread make me doubt the currency of the contained information and I've been unable to find any documentation on this "unixlib". winestreamproxy would in theory serve as a decent enough example to copy off of in lieu of docs, but it relies on winegcc, which I can't use because of my Rust codebase.

I've also seen mentions of PE binaries running on Wine being able to execute Linux syscalls, which would be a fine alternative to all this, but I don't know how that would be possible on 8.10+ due to the syscall translation interface and I have again been unable to find any relevant documentation (Wine Developer's Guide/Kernel modules and Wine Developer's Guide/Architecture Overview are both 8+ years out of date).

Both the .dll and .so are being compiled for i686 and I'm testing this in a win32 prefix.
Locked