
How do Win 3.1 applications work in Wine? - pantalaimon
http://www.wine-staging.com/news/2016-02-10-blog-wine-16bit.html
======
shmerl
Interestingly, even some Windows 95 applications require 16 bit support. For
instance The Neverhood. Linux had a regression when it stopped working at tome
point (which is now fixed):

[http://news.softpedia.com/news/Linux-Kernel-3-14-Breaks-
Wine...](http://news.softpedia.com/news/Linux-Kernel-3-14-Breaks-Wine-
for-16-bit-Windows-Applications-447273.shtml)

[https://bugs.winehq.org/show_bug.cgi?id=36664](https://bugs.winehq.org/show_bug.cgi?id=36664)

Not that it matters much anyway, since The Neverhood works in ScummVM now. But
in practice Wine now better supports such application than any recent Windows
itself.

~~~
TazeTSchnitzel
Some of the apps included in Windows 95 were 16-bit, for performance or
because they didn't have time to update them.

~~~
xufi
Interesting. I always found it that i wanted to the run old apps on WINE.
Imagine running Phone Dialer on WINE and making a call

------
pavlov
There's something about Win32's C style that just makes my eyes bleed:

    
    
      static LRESULT WINAPI MCIWndProc16(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
      {
        switch (msg)
        {
        case MCIWNDM_SENDSTRINGA:
            lparam = (ULONG_PTR)MapSL(lparam);
            break;
    
        case MCIWNDM_SETTIMEFORMATA:
            lparam = (ULONG_PTR)MapSL(lparam);
      ...
    

All caps for typedefs in C is just evil. And this example doesn't even have
Hungarian notation.

~~~
agumonkey
It's doubly sad when you think that most people will see this first. I
understand that's a complex and real product so to hell with idealism, but
when you see code like:

[http://piumarta.com/software/maru/](http://piumarta.com/software/maru/)

it makes C much more loveable.

ps: I'd love to see other beautiful C codebases. (ZFS ain't bad)

~~~
beefhash
> ps: I'd love to see other beautiful C codebases. (ZFS ain't bad)

See also:
[https://news.ycombinator.com/item?id=11005003](https://news.ycombinator.com/item?id=11005003)
\-- It's not only C, but there are some C codebases on there.

~~~
agumonkey
Thanks, lots of good things there :)

------
0x0
The most interesting takeaway here is perhaps that wine manages to run win16
in x86-64 mode, something that even microsoft gave up on in their 64bit
windows releases.

~~~
TazeTSchnitzel
Oh, Microsoft could have done it, they just didn't want to. And that was
hardly an unreasonable decision: 16-bit apps were basically only being used
for installers by the time of Vista.

------
rossy
I didn't know it was common for operating systems to let user-mode code adjust
the memory segments and for them to persist those changes between context
switches. It seems like a pretty niche feature to have in a 64-bit operating
system, though I'm glad it's there. I only recently tried to run a 16-bit
program in Wine on a 64-bit machine and I was pleasantly surprised to see it
work perfectly.

------
chris_wot
Wow! Seems like an elegant solution. Does this work on architectures other
than x86?

~~~
qb45
I think it works perfectly on all architectures capable of executing 16-bit
x86 code :)

~~~
chris_wot
Yeah, dumb question :-)

