According to the DPMI specification, when DPMI function 0800h (Physical
Address Mapping) fails then the carry flag has to be set.
For example if the application request for physical memory mapping via the
DPMI 0800h call it is required to set carry flag to indicate failure.
Otherwise application would be treated as successful operation in which
case in BX:CX registers is stored linear address of the mapped memory to
which application can access. Obviously on successful path if the BX:CX
registers are not set then application would try to access random memory
and crashes.
SysToolsLib, WinIO or libpci are just few examples of 32-bit Windows
libraries which issue this DPMI call via the kernel32.dll VxDCall()
function and are expecting either the carry flag on the failure or the
valid mapped address in BX:CX registers on success.
As the wine does not implement this DPMI function, always sets the carry
flag.
Windows NTVDM DPMI host does not implement the DPMI function 0800h too and
also always sets the carry flag. Tested and verified with a very simple
gcc/djgpp application on Windows NT.
So this also change aligns the wine behavior with the Windows NT.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7905