My recent favorite Windows lore: Microsoft once cracked the Bluetooth driver code by including the ® symbol in the mouse’s custom name

Published:

There’s something I find extremely comical about the exploit of copyright and trademark symbols in games. I understand why these symbols are significant in a legal context, but was it really necessary to put an ® or ™ next to each character’s name in Dragon Ball Z Budokai 3 fighting game on PlayStation® 2? Everyone knows you own Goku, buddy. They can’t steal it just because you didn’t post the icon somewhere.

But I suppose corporate legal departments often get their way, even if the end result looks stupid or causes a real headache. I recently learned about a perfect example of the latter while reading about Bluetooth drivers for Windows, and I swear to God it’s both more engaging and fun than you’d expect from any story about Bluetooth drivers for Windows.

“Is the Microsoft Wireless Notebook Presenter Mouse 8000 treated favorably by Microsoft Bluetooth drivers? Is this some kind of collusion? No, it’s not” – Veteran Microsoft developer Raymond Chen recently wrote on his confidential blog, The Old New Thing.

As Chen explained, there are plenty of suspicious devices that don’t behave as they should when plugged in. They may not be properly following the rules of the USB protocol. Maybe someone made a little typo that slipped through the cracks. Maybe they thought they were compliant because the version of Windows they were testing on didn’t actually meet some security requirements, but a later update tightened the standards.

Sometimes these types of errors can cause your computer to crash. But usually cold hardware just requires the Windows driver code to include some little workaround to parse out what it’s supposed to do. What is much more unusual is that the device fails at the very first stage: its name literally comes in handy.

“In most cases, the code that compensates for these types of errors does not reveal its presence in the form of hard-coded strings. Instead, you have ‘other’ branches that secretly fix or ignore corrupted values,” Chen wrote. “Unfortunately, the error made by the Microsoft Wireless Notebook Presenter Mouse 8000 is one that can easily be exposed via strings because it mixed up the strings!”

Okay, what does all this mean exactly? Hard coding (embedding specific data directly into the source code) does Programming in general doesn’tso if the Windows team had to hard-code something into the Bluetooth driver, it must have been really screwed up.

Each hardware device has a “local name” in its code that identifies it. This name is to be encoded with UTF-8 standardby far the most popular standard for encoding digital text. This article and almost the entire internet follows him today. But you know what didn’t happen? Microsoft Notebook 8000 Wireless Presentation Mouse.

Here’s how Chen explained the problem:

“Microsoft Wireless Notebook Presenter Mouse 8000 reports its name as Microsoft⟪AE⟫ Wireless Notebook Presenter Mouse 8000, encoding the registered trademark symbol ® not in the UTF-8 format as required by the specification, but in the format code page 1252. Worse still, ⟪AE⟫ itself is not a legal UTF-8 sequence, so the string wouldn’t even show up as corrupt; would be rejected as invalid.”

(Image source: Microsoft)

Code page 1252, also known as Windows-1252, was the dominant encoding standard for Windows devices from the 1980s to the tardy 1990s. If you remember ever opening a document created in Windows on your Mac and seeing lots of question marks, it was because Windows-1252 contained characters that other operating systems couldn’t display. Fortunately, due to the ubiquity of UTF-8, these types of annoyances are sporadic these days.

However, when the Wireless Notebook Presenter Mouse 8000 was being designed, someone at Microsoft was apparently still stubbornly (or accidentally) using the elderly encoding format. Or maybe the mouse actually fell victim to some idle copy/pasting that went terribly wrong.

“Thank you to the Legal Department for putting the ® in the descriptor and ruining the whole thing,” Chen wrote. “There is a special table in the Bluetooth drivers for “Devices that report invalid names (and the correct name to use).” If the Bluetooth stack detects one of these devices and presents an incorrect name, it will be replaced with the correct name.

“This table currently has only one entry.”

Related articles