Windows Libraries for OS/2
Microsoft Windows Libraries for OS/2 (shortened to WLO) is an implementation of the Win16 API for OS/2 1.21 and higher, along with an SDK for converting existing Win16 applications to run on OS/2.
History
The first version was 0.9, announced on February 4, 1991 as Microsoft Windows Libraries for OS/2 Development Kit[1][note 1]. To make matters confusing, as is common with Microsoft, another "advanced" version named 0.9 was distrubuted on Compuserve earlier on January 1, 1991. This version is, according to Microsoft and unlike 0.9 DK, not compatible with later versions.
Version 1.0 was released some time after that, along with a Demonstration Applications distribution (WLO10.ZIP), containing WLO DLLs and the so-called Windows 3.0 accessory applets, which are ports of Calc, Calendar, Cardfile, Clipboard, Clock, Notepad, Paintbrush, Reversi, Solitaire, Windows Help, and Write from Windows 3.0. This is the only known preserved distribution of WLO, hence most of the information in this article is derived from it, if not specified otherwise.
No later version is known to exist, and most likely it doesn't, since IBM and Microsoft parted ways later in 1991. OS/2 2.0 and later includes WinOS/2, which makes use of 386 specific features; however, WLO 1.0 still works at least up to OS/2 Warp 4.5[2][3].
Development
TODO: Write up how to build WLO applications under OS/2 or Windows/DOS.
Implementation
Unlike the later WinOS/2, no virtualization is used to implement WLO. Instead, it makes use of the fact OS/2 and Windows executables have the same format, which is New Executable (NE, sometimes also called segmented executable). This is a rather complicated format, the precise description of which is out of the scope of this article. What is important here is that it contains a module reference and imported names table, which specify which modules are used by the program[4].
These are usually at the beginning of the file, hence they can be analyzed using simple string extraction:
$ strings ie5win31.exe | head This is a Windows self-extracting ZIP file. You can run it from Windows or unzip it with a utility like WinZip or PKUNZIP.$ WZ-SE-01 KERNEL KEYBOARD USER
Here, the module names are KERNEL, KEYBOARD, and USER. These correspond to other New Executable files and contain functions that can be imported into and used to by the original program (more precisely, for this case these contain the functions exported by Windows itself). Windows can have various extensions here, for example on Windows 3.0, the corresponding files are KERNEL.EXE, USER.EXE, and KEYBOARD.DRV (all in C:\WINDOWS\SYSTEM), however, these are, in fact, of course all NE executables.
WLO ships its own version of these Windows modules, which are named KERNEL.DLL, USER.DLL, and KEYBOARD.DLL, and reside in C:\OS2\DLL (which is one of the default library paths, hence they will be found when launching an Windows executable). These are essentially a Windows implementation on top of OS/2 instead of DOS, making use of Presentation Manager for GUI.
When a Windows executable is launched on a OS/2 system with WLO installed, it is treated the same as an OS/2 executable linking to the aforementioned modules; if you are lucky (see the compatibility section below), it will work as expected. On WLO 0.9, relinking was necessary, but with WLO 1.0, this is no longer required[5].
Interface compatibility
WLO implements the vast majority of functions in GDI, KERNEL, KEYBOARD, SOUND, SYSTEM, and USER. Currently only functions known to be missing are functions called by integral parts of Windows like Program Manager.
Compatibility of executables
Generally, Windows binaries that only use the C runtime and Windows functions should run without issue under WLO, provided they only use Win16 interfaces implemented by WLO (see above). Binaries using direct DOS calls using INT 21h or similar will trap, since this interface is not present under OS/2[note 2]. These include stock Windows 3.0 applications like CLOCK (traps on DOS call to get time) and NOTEPAD (traps on DOS call to exit program).
Some (but not all) applications other than WLO applets display a compatiblity warning ("Application has not been tested to run compatibly on OS/2. Choose Cancel to quite or OK to proceed. If you choose OK, the application could terminate unexpectedly"). Setting OS2EXEFlags to 0x80, a possibly undocumented flag (only bits 0, 1, 2, 3 are known to be used) present on WLO applets, removes the warning (tested on FLAGGEN.EXE); this is probably an option to override it or something similar.
Some applications, for example CONTROL.EXE and PROGMAN.EXE from Windows 3.0, are missing functions in DLLs, and fail with "SYS0182: The operating system cannot run %1."[note 3]. Others, for example RECORDER.EXE, and most programs for Windows 3.1 (including PBRUSH.EXE, whose 3.0 version works), are missing DLLs, and fail with a rather generic error "Cannot find the file or directory. Be sure that the path(s) and file name(s) are entered correctly. (PMV1024)".
yksoft1 mentions in the BetaArchive post referenced earlier using a special "WLO's" stub and changing a byte to create a WLO executable from Windows 3.0 SDK examples. There is indeed a specific MS-DOS stub in the WLO applets (in contrast with their Windows 3.0 counterparts, whose MS-DOS stub only displays "Cannot be run in DOS mode"); when run in DOS mode, it prints '<executable-name>: can't open quotefile "quotes.txt"', pauses for a few seconds and exits. If quotes.txt exists, it prints its contents instead of the error mesasge. WLO 0.9 did not have the stub, at least from what is known from the description on how a WLO 0.9 binary is created in IBM PSD.
Compatibility of DLLs
TODO: Add information from IBM PSD and do research on WLO 1.0
Static version of WLO
TODO: Microsoft Word and Excel for OS/2
Notes
- ↑ Wikipedia says April 2, 1987, but this is likely an error, since that pre-dates the release of OS/2 1.0 by a few months.
- ↑ Under real-mode Windows, these are handled by the underlying DOS directly; protected mode Windows works as a DOS extender.
- ↑ While this is not officially confirmed to be the meaning of the error, it is heavily implied, since it is reported to happen when 1.2 DLLs are used with 1.3 code, and also happens when running 2.0 applications on 1.3.
References
- ↑ https://web.archive.org/web/20060206232522/http://pages.prodigy.net/michaln/history/pr/wlo.html
- ↑ https://web.archive.org/web/20011208005210/http://pages.prodigy.net/michaln/history/os213/index.html
- ↑ https://www.betaarchive.com/forum/viewtopic.php?t=14196
- ↑ https://www.pcjs.org/documents/books/mspl13/msdos/encyclopedia/appendix-k/
- ↑ IBM Personal Systems Developer Magazine, Summer 1991, pages 32-38.