Apparent bugs in Windows’ IrDA support

The next version of Microsoft Windows, codename Vista, née Longhorn, is currently in the beta phase and the release notes for Beta 1[i] contains the following section:

Infrared (IrDA) Devices: There are known issues with IrDA devices. There are no workarounds at this time. These issues include the following:

• When you transfer files using an IrDA device, they are saved in C:\Users\Default User\Desktop instead of the desktop for your account.

• Certain devices can take up to 20 minutes to discover each other.

• Certain IrDA device drivers cannot be uninstalled successfully.

• Certain IrDA devices can cause the system to stop responding for up to 40 seconds if the infrared transmission is interrupted.

I presume that it’s intended that these problems will be fixed before its release.  There are also two other sets of issues, firstly those listed in the Knowledge Base (see my summary[ii]), and secondly a set of issue that are not listed but have been experienced in the wild.  It would be unfortunate if any serious issues not listed in the release notes were not fixed at the same time.  I thought it would be helpful to write a quick document noting what issues I experience most often that cause me problems, or have had reports of that cause serious problems.

I list the issues below, giving a severity in the title and in the description note any overlap with any release note or KB issue.  I focus here on the stack alone but there are apparently also some issues in the Wireless Link/Infrared Monitor application (including two in the KB), but I haven’t investigated it thoroughly enough, and the error messages produced are not generally very illuminating.

If you’ve any questions or need any other help please contact me at alanjmcf AT yahoo.com.

Protocol stack issues

Illegal maximum LSAP Selectors used [HIGH]

Fixed in Vista.  Verified in RC1.

The IrDA stack in Windows will use illegal LSAP Selectors (like TCP's Port Numbers); this is very unfortunate because all third-party devices that I have tested refuse to talk to such a port number.  I first discovered this when on some occasions my Palm could not do infrared HotSync, and restarting HotSync Manager on the PC didn’t help.  I then took a trace of the IrDA frames between the two devices and found that HotSync Manager had been assigned an illegal LSAP-Sel by Windows.  The Palm of course could not connect to it.

The LSAP Selector values are held in the IrLMP header in two seven-bit fields, but values of 0x70 and above are reserved, as is the value zero.  The legal range is thus 1 to 0x6F (111), but Windows will illegally use the whole range up to 127.  This can be seen reproducibly; firstly in the scenario that I experienced: set HotSync Manager listening on infrared and hibernate/resume a couple of weeks’ worth of times (a common scenario given XP’s stability and usage) and the problem will be seen at some point.  To a normal user there is no indication this particular problem is occurring, and recovering from it is difficult: either reboot, or hibernate until it works!  Just restarting HotSync Manager is not a solution, as simply the next of the sixteen illegal LSAP-Sels will be assigned.

Or secondly, one can use a simple program I have produced that can repeatably show Windows assigning illegal values.  For information on it and its usage, see an email that I have previously sent to a Microsoft engineer.

As I note there, the fix to this is likely simple and localised: where the code checks whether the next LSAP-Sel is greater that 0x7F, it should simply check instead for 0x6F.

KB906857 describes a problems where Windows 2000/XP can’t send a file to a Windows 98 machine, but it works eventually if one retries enough times!  Windows 98 is blamed there, but to me it sounds likely that it could be caused by this fault.  I haven’t got a copy of Windows 98 to hand to test this.

Discovery of some third-party device types [HIGH]

As I described in “Problems with Palm IrDA discovery alongside XP notebooks” [iii], on some machines Windows fails to discover some peer device types, and on others, the length of time it takes to discover them is high when the two devices are close.

This sounds closely related to the second issue reported for Vista Beta 1, “Certain devices can take up to 20 minutes to discover each other.”

Again here the fix is likely simple, at least for the first issue: simply slow the discovery process; that is increase the time between each of the XID frames, which will give the peer device more time to respond.  It might even be the solution to the second part too.

No IrLMP mode on server side [FEATURE]

A number of correspondents have asked how to make Windows appear as an IrDA Printer, wanting to allow other devices to print through the Windows box to a connected printer, or to capture the print for other processing.  This requires that the application use IrLMP mode, and listen on Service Name “IrLPT”.  However investigation showed that on server sockets the IRLMP_IRLPT_MODE option is ignored, and this was later confirmed by a Microsoft engineer.[iv]

There seems no particular reason why this mode could not be supported on server-side sockets, as there is no difference in stack behaviour required from client-side.  It is likely thus that the fix is simply to propagate the flag from the Winsock level to the stack.  It would be useful in the scenario described and others for this mode to be provided.

Unicode host name format [LOW]

Strings in the IrLMP protocol are sent either as ASCII, as one of the ISO 8859 character sets, or as Unicode, by which I presume it intends UNICODE-16BE.  When sending its device name Windows apparently uses ASCII if it can, or if the hostname contains any non-ASCII characters uses Unicode, but in Windows’ native form UNICODE-16LE.  Thus only Windows machines will understand such strings.

 

Copyright © 2005 Alan J. McFarlane

 

Change history

27th October 2005       Initial Version

30th January 2007        Note Vista has fixed “Illegal maximum LSAP Selectors used”.

 

 



[i] “Release Notes for Windows Vista Beta 1 and Windows Server “Longhorn” Beta 1” http://www.microsoft.com/technet/windowsvista/relnotes.mspx as of 2005-Oct-20.

[ii] “Microsoft KB articles on infrared subjects” http://www.alanjmcf.me.uk/comms/infrared/Microsoft KB articles on infrared subjects.html

[iii] “Problems with Palm IrDA discovery alongside XP notebooks” http://www.alanjmcf.me.uk/comms/infrared/Problems with Palm IrDA discovery.html

[iv] Discussing server-side IrLMP mode (IRLMP_IRLPT_MODE) online http://groups.google.co.uk/group/microsoft.public.win32.programmer.networks/browse_frm/thread/79c2312aaeaaae69/4d4bd512e8ea1c36 , my debugging on July 6th and Mazahir’s confirmation on the 26th.