Small correction if I may: Windows 3.1 did not add Win32S.
Win32S was an optional extra: a separate download and was never included with any version of Windows 3.x.
Win32S came along sometime later -- I think approximately in the time frame of Windows for Workgroups 3.11.
There were two purposes for Win32S: an official public one, and a secret one.
The official one was that it allowed developers to experiment with the new Win32 API, develop applications for Windows NT but which could be deployed onto Windows 3.1.
The secret reason behind Win32S was that it didn't work very well if Windows 3 was being hosted on top of a different 32-bit operating system. In other words, to be specific, it gave IBM a really hard time supporting Win32S in WinOS2 on top of 32-bit OS/2. So these new Win32S applications wouldn't run on top of IBM's OS/2 2.x. IBM kept finding ways to implement the additional Apis in Win32S, and Microsoft get changing them and putting out new point revisions of Win32S which broke those Apis again on OS/2.
Eventually the final version did this so effectively that as for as I know IBM never managed to get it entirely working.
By the way Win32S is still out there and you can still download it. There are not many reasons that you would want to do that, but there is one: it includes the original demonstration app for Win32S -- Microsoft Freecell.
This 30-year-old binary runs perfectly on Windows 10 64-bit and Windows 11. You can download Win32S, unpack the zip file, and just copy the files called `freecell.*` to wherever you want. Bingo: the original tiny Freecell Game, in place of the bloated advertisement filled one on the Windows store, for nothing. Enjoy.
> Small correction if I may: Windows 3.1 did not add Win32S.
>
> Win32S was an optional extra: a separate download and was never included with any version of Windows 3.x.
Andrew Schulman (in Unauthorized Windows 95) and Matt Pietrek (in Windows Internals) both describe the Windows 3.1 EXE loader as shipping with special case code for detecting PE executables. Win32s was an add on to Windows 3.1, but Windows 3.1 shipped out of the box with the necessary hook.
Whether or not that qualifies as Windows 3.1 _adding_ Win32s is a matter of packaging. (But it is why I used the wording I did.)
> IBM a really hard time supporting Win32S in WinOS2 on top of 32-bit OS/2.
Interesting, I never imagined Win32s working on OS/2 at all. I didn't use it much, but I always envisioned the Windows on OS/2 2.x as being closer to Standard mode (286) windows, since the Windows VMM probably didn't run on OS/2. But like I said... I didn't use it much.
Related to this: do you happen to remember Microsoft's earlier solution for 32-bit code on Windows? Predating Win32s, I remember there being a library that allowed allocation of 32-bit memory and jumping to 32-bit code. This code wasn't like Win32s code that had API access (it didn't), but it was a rudimentary way to access 32-bit offsets.
There's a bit of nuance in what I was saying.... I agree (and agreed) that Windows 3.1 didn't include Win32s. What it _did_ include, though, is direct support for Win32s in the form of PE executable detection and a hook for the (separately installable) Win32s PE loader.
Win32S was an optional extra: a separate download and was never included with any version of Windows 3.x.
Win32S came along sometime later -- I think approximately in the time frame of Windows for Workgroups 3.11.
There were two purposes for Win32S: an official public one, and a secret one.
The official one was that it allowed developers to experiment with the new Win32 API, develop applications for Windows NT but which could be deployed onto Windows 3.1.
The secret reason behind Win32S was that it didn't work very well if Windows 3 was being hosted on top of a different 32-bit operating system. In other words, to be specific, it gave IBM a really hard time supporting Win32S in WinOS2 on top of 32-bit OS/2. So these new Win32S applications wouldn't run on top of IBM's OS/2 2.x. IBM kept finding ways to implement the additional Apis in Win32S, and Microsoft get changing them and putting out new point revisions of Win32S which broke those Apis again on OS/2.
Eventually the final version did this so effectively that as for as I know IBM never managed to get it entirely working.
By the way Win32S is still out there and you can still download it. There are not many reasons that you would want to do that, but there is one: it includes the original demonstration app for Win32S -- Microsoft Freecell.
This 30-year-old binary runs perfectly on Windows 10 64-bit and Windows 11. You can download Win32S, unpack the zip file, and just copy the files called `freecell.*` to wherever you want. Bingo: the original tiny Freecell Game, in place of the bloated advertisement filled one on the Windows store, for nothing. Enjoy.