I recently spent some time trying to access disks shared by a Windows 7 machine from various versions of OS/2 (running in VMs, although that’s not really relevant). The OS/2 clients ranged from OS/2 1.3 with LAN Manager 2.1 (1991 vintage) to MCP2 (released in 2001/2002), in all cases configured to use only NetBIOS over TCP/IP transports.
This endeavor was far more difficult than it should have been. One part of the problem is that the default Windows 7 configuration is inimical to all older Microsoft/IBM network clients, including DOS, Windows 9x, and old versions of Windows NT. That is more or less obvious and relatively well documented.
With the necessary changes on the Windows 7 side in place, OS/2 clients can connect to Windows 7 shares and browse disks. However, attempts to access files more often than not result in SYS0240: The network connection is disconnected.
The behavior is quite confusing though. Some programs may be executed, text files can be displayed with the TYPE command, but a COPY to a local disk (i.e. from a disk shared by Windows 7 to a local disk on an OS/2 client) almost always fails with SYS0240. That is, all files but those smaller than about 4KB fail to copy.
That is certainly not the expected behavior. A packet trace revealed that access to a small file is handled as a single SMB request (albeit split into several TCP packets). For larger files, the first 4KB are read successfully, but then OS/2 issues a so-called multiplexed read (“Read MPX” in Wireshark). Rather than failing such request on the SMB level, Windows 7 resets the TCP connection. That is, unsurprisingly, translated into a SYS0240 error.
It is questionable whether this is a bug in Windows which aborts the TCP connection rather than returning a SMB error, or if OS/2 should not even attempt multiplexed reads. However, that is largely an academic question; the real question is whether anything can be done about it.
As it turns out, the answer is “yes”. The OS/2 Workstation (in LAN Manager terminology) or Requester (in IBM parlance) can be easily adjusted to avoid issuing multiplexed reads and write requests. The key is the wrkheuristics parameter in the [workstation] section of the appropriate .INI file. For Microsoft LAN Manager, that is \LANMAN\LANMAN.INI, for IBM LAN Requester it’s \IBMLAN\IBMLAN.INI, usually on the C: drive. The files have essentially identical format.
On newer versions of OS/2, the wrkheuristics parameter is already present and populated with the default values. On LAN Manager, it might not exist and must be created first. In any case, “bits” 14 and 15 must be changed from 0 and 1. That will disable the use of multiplexed reads and writes, respectively. This is documented at least as far back as the Microsoft LAN Manager Administrator’s Reference, Version 2.0 from 1990 (document number SY10468-0590).
The default setting of wrkheuristics looks as follows:
; 1 2 3 4 ; 01234567890123456789012345678901234567890 wrkheuristics = 11111111213111111110010111200112210000000
That must be changed to the following:
wrkheuristics = 11111111213111001110010111200112210000000
That is, the digits in position 14 and 15 must be changed to zero.
After changing the INI file, the workstation/requester must be restarted (rebooting OS/2 is not necessary). Once the change is active, OS/2 can read from and write to Windows 7 shares successfully. Whew!
Disabling multiplexed reads and writes has been previously documented as desirable when connecting to newer Samba servers. However, for accessing Samba shares, it is only a performance optimization. For accessing Windows 7 shares, it is absolutely essential.
It does not appear that disabling multiplexed reads/writes has any adverse effect when using NetBIOS over TCP/IP as multiplexing is actually not relevant for connection-oriented transports such as TCP.
For reference, the default administrator account on old LAN Manager setups is ADMIN/password. On IBM LAN Requester it is often USERID/password. Note that the user name is not case sensitive while the password is.