The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
The fun and profit of manipulating the DIB color table can be done without having to modify it
If I were Michael Kaplan, I'd have a more clever title like I'm not touching you! or Look but don't touch or maybe Looking at a DIB through -colored glasses. We saw some time ago that you can manipulate the DIB color table to perform wholesale color remapping. But in fact you can do this even without modifying the DIB color table, which is a handy trick if you want to do color remapping but you don't want to change the bitmap itself. For example, the bitmap is not one that is under your control (so you shouldn't be modifying it), or the bitmap might be in use on multiple threads (so modifying it will result ...
Failed follow-up: The case of the dubious dental work
I've been waiting for an opportunity to do a follow-up on this story, but the trail appears to have gone cold. Here's the story as we know it so far: In 2004, a woman (who had previously run unsuccessfully for a city council position) files a $6,370 claim for dental work against McDonald's, claiming that she injured her teeth biting into a cherry pie. Less than three months later, she files a $6,006 claim against McDonald's for dental work resulting from biting into a piece of bone in a cheeseburger patty. The insurance company investigates and determines that both claims were false: The dentist who allegedly ...
Speculation on how a mishandled 13-character string can result in a blue screen
Commenter nolan reminisces about an old Windows 95 bug in the networking layer that crashed if a string was exactly 13 characters long. "So for the past 10 years or so, I've been wondering exactly how one could write code with that bug. Any bug that weird has to have a great story behind it." I don't know what the story behind it is, but if after ten years you still can't imagine how such a bug could be possible, you don't have a very active imagination. If the host name is exactly 13 characters, then this code overflows the buffer by one character, corrupting the stack. A crash is hardly surpris...
The world reaction to the unexpected death of Michael Jackson extends to young children
I had occasion to meet up with the same family whose two-year-old was learning to lie in an earlier story. It was only a day or two after the death of Michael Jackson, and the older sister (five years old) told me, "Did you know? Michael Jackson, he went to sleep and he is never going to wake up." Her younger sister (now three), corrected her. "No, he's dead!"
If dynamic DLL dependencies were tracked, they'd be all backwards
Whenever the issue of DLL dependencies arises, I can count on somebody arguing that these dynamic dependencies should be tracked, even if doing so cannot be proven to be reliable. Even if one could walk the call stack reliably, you would still get it wrong. The example I gave originally was the common helper library, where loads via an intermediate function in . You want the dependency to be that depends on , but instead the dependency gets assigned to . "But so what? Instead of a direct dependency from to , we just have two dependencies, one from to , and another from to . It all comes out to the same t...
Film students and The Bicycle Thief
The current generation of young people grew up in a very different world from us older folks. There has always been an Internet. Everybody is accessible by mobile phone. Cars have always had power windows. (Which reminds me of a story of a friend of mine who has an older-model car and was giving a ride to an eight-year-old relative. The youngster pointed at the window crank and asked, "What's this?" Upon learning its purpose, the young passenger spent the remainder of the trip opening and closing the window, giggling with glee. "You know, most people pay extra so they don't have to do that.") But it's not just e...
MS-DOS also allowed spaces in file names, although vanishingly few programs knew how to access them
A little-known fact about MS-DOS is that it allowed spaces in file names. Sure, you were limited to 8.3, but a file called "" was legal in MS-DOS, and you could indeed create such a file. Good luck finding programs that didn't treat you as insane when you asked for that file, though. Although the file system supported files with spaces, practically no programs supported them. Command line tools saw the space as the end of the file name. You couldn't quote the file name because no command line tool supported quotation marks to protect spaces. After all, if you believed that spaces were illegal characters in file ...
Up and down often substitute for compass directions, but you have to know when you've taken it too far
The official curriculum for seventh grade students in the state of Washington includes Washington history and geography. My friend the seventh grade teacher typically includes as part of this curriculum an assignment wherein each student is assigned one of the state's counties on which to produce a brief report. It is common to substitute up and down for north and south when speaking informally, but it is also important to know when you've taken the substitution too far. One student's report on Pierce County began with the following sentence: Pierce County is at the bottom of Puget Sound.
Attack of the rogue feature: Oh no, where did my Explorer icon labels go?
A customer reported that on Windows Vista, if you hold down the shift key and repeatedly click the View button in the command bar of an Explorer window, you will eventually reach a state where all the labels under the icons have disappeared! Where did they go, and how do I get them back? Congratulations, you stumbled across a rogue feature. One of the developers who worked on Windows XP decided to add a cute shortcut: Holding down the shift key when switching to Thumbnail mode will cause the labels to disappear. (At least, that was the intent of the rogue feature, but it so happens that as a side effect,...