My new favorite deep Windows lore: Microsoft once broke its Bluetooth driver code by sticking a ® symbol in the name of its own mouse

There's something I find deeply funny about the use of copyright and trademark symbols in games. I get why these symbols are important in legal contexts, but, like, was it actually vital to display ® or ™ next to every character's name in the Dragon Ball Z Budokai 3 fighting game on the PlayStation® 2? Everybody knows you own Goku, dawg. They can't steal him just because you didn't slap down that icon somewhere.

But I suppose corporate legal departments often get their way, even when the end result looks silly or causes actual headaches. I recently learned about a perfect example of the latter by reading about Windows Bluetooth drivers, and I swear to god it's both more interesting and funnier than you're expecting any story about Windows Bluetooth drivers could possibly be.

Back in 2006, Microsoft released a seemingly innocuous device called the Microsoft Wireless Notebook Presenter Mouse 8000. This was only about four years after the company's first-ever Bluetooth mouse; the technology was still pretty new at the time and wouldn't become the go-to for wireless office mice for another decade. The Presenter Mouse wasn't focused on accuracy or polling rate like a gaming mouse; its gimmick was that it had a bunch of buttons on the bottom for going forward and backwards in a PowerPoint presentation, changing volume, etc. It was for presentations. Like I said, innocuous.

Seemingly.

Turns out the Microsoft Wireless Notebook Presenter Mouse 8000 is also infamous, at least among programmers who regularly go digging through the bowels of Windows driver code. Because deep inside Windows' Bluetooth drivers you can actually find the name of the mouse, written out in plain English. This is highly unusual.

"Does the Microsoft Wireless Notebook Presenter Mouse 8000 receive favorable treatment from the Microsoft Bluetooth drivers? Is this some sort of collusion? No, it’s not that," veteran Microsoft developer Raymond Chen recently wrote on his insider blog The Old New Thing.

As Chen explained, there are loads of sketchy devices out there that don't behave how they're supposed to when you plug them in. Maybe they don't properly follow the rules of the USB protocol. Maybe someone made a tiny typo that slipped through the cracks. Maybe they thought they were following the rules because the version of Windows they tested on wasn't actually validating some security requirement, but a later update tightened up its standards.

Occasionally these sorts of mistakes can cause a computer to crash outright. But usually funky hardware just requires the Windows driver code to include some kind of small workaround to parse what they were supposed to do. Far, far more unusual is a device failing at the very first step: literally getting its own name right.

"Most of the time, the code to compensate for these types of errors doesn’t betray its presence in the form of hard-coded strings. Instead, you have 'else' branches that secretly repair or ignore corrupted values," Chen wrote. "Unfortunately, the type of mistake that the Microsoft Wireless Notebook Presenter Mouse 8000 made is one that is easily exposed via strings, because they messed up their string!"

Okay, what does all that mean exactly? Hard-coding (embedding some specific data right in the source code) is generally a programming no-no, so if the Windows team had to hard code something in the Bluetooth driver, it must've been really screwed up.

Every hardware device has a "local name" in its code that identifies it. This name is meant to be encoded with the UTF-8 standard, by far the most common encoding standard for digital text. This article and pretty much the whole internet follow it today. But you know what didn't follow it? The Microsoft Wireless Notebook Presenter Mouse 8000.

Here's how Chen explained the problem:

"The Microsoft Wireless Notebook Presenter Mouse 8000 reports its name as Microsoft⟪AE⟫ Wireless Notebook Presenter Mouse 8000, encoding the registered trademark symbol ® not as UTF-8 as required by the specification but in code page 1252. What’s even worse is that a bare ⟪AE⟫ is not a legal UTF-8 sequence, so the string wouldn’t even show up as corrupted; it would get rejected as invalid."

Windows 3.1

(Image credit: Microsoft)

Code page 1252, aka Windows-1252, was the dominant encoding standard for Windows devices from the '80s to the late '90s. If you remember ever opening a document created in Windows on a Mac and seeing a bunch of question marks, that's because Windows-1252 included characters that couldn't be rendered by other operating systems. Thankfully with the ubiquity of UTF-8 those sorts of annoyances are rare these days.

But back when the Wireless Notebook Presenter Mouse 8000 was designed, someone at Microsoft was apparently still stubbornly (or accidentally) using the old encoding format. Or maybe the mouse was actually the victim of a lazy copy/paste gone horribly wrong.

"Thanks, Legal Department, for sticking a ® in the descriptor and messing up the whole thing," Chen wrote. "There is a special table inside the Bluetooth drivers of 'Devices that report their names wrong (and the correct name to use).' If the Bluetooth stack sees one of these devices, and it presents the wrong name, then the correct name is substituted.

"That table currently has only one entry."



source https://www.pcgamer.com/hardware/microsoft-windows-wireless-notebook-presenter-mouse-8000-bluetooth-driver/

Comentarii