[Bug 51564] Can't run 16bit programs when built without mingw

WineHQ Bugzilla wine-bugs at winehq.org
Sun Oct 3 08:00:43 CDT 2021


https://bugs.winehq.org/show_bug.cgi?id=51564

--- Comment #12 from O. Nykyforchyn <oleh.nyk at gmail.com> ---
I am also affected by this bug, it makes it impossible to use old but nice
16-bit WinEdt 1.41e with TeXLive on Linux. After some digging in the latest
wine-6.18 sources I found out the cause of the problem. After the above
mentioned commit for launching 16 bit modules Wine in ntdll uses
find_builtin_without_file -> open_dll_file -> NtCreateSection, which makes a
request ( create_mapping ) to wineserver, which in turn fails with
STATUS_INVALID_IMAGE_WIN_16 and returns no mapping.

Hence I made some changes to ntdll and a bit to wineserver to provide a partial
solution. Now wineserver still issues STATUS_INVALID_IMAGE_WIN_16 but returns a
fake (almost zeroed) mapping with WineFakeDll flag if fake 16 bit dll is found.
Upon this open_dll_file stops search and replaces STATUS_INVALID_IMAGE_WIN_16
with STATUS_INVALID_IMAGE_NOT_MZ that asks to try .so library instead. It its
path "-windows", if found, is replaced with "-unix", ".so" is appended, so real
library is loaded instead of fake 16 bit one. 

All this is in unix-16bit.patch against wine-6.18 source, hope it applies
cleanly also to git wine sources.

I am not sure whether it is a proper fix, but at least WinEdt.exe starts now.
Unfortunately, all checkboxes in configuration dialogs are dead (empty and not
responding), and text input field is black instead of white with text in
strange colors and displaced randomly. I would be grateful for a hint whether
it connected with this bug or the cause is somewhere else.

Probably the attached patch, if does not solve the problem, can be a step in
right direction. It could be interesting to try it with other apps. If it
helps, I could polish it and submit to Wine developers.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list