The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
The great thing about naming conventions is that not everybody will follow them
The naming convention for is «facility»«severity»«name», where the facility portion (and the underscore) is omitted if the facility is or . Good luck finding anybody who follows this naming convention. Okay, fine, if you look closely you might be able to find some people who do. Actually, I guess I was a bit too pessimistic when I said nobody follows it. It seems that the majority of Windows components do follow this convention, although there are some notable exceptions. There are also some people who decided to confuse matters further by using the convention for erro...
Isn't every dinner at a technology conference a geek dinner?
I'm always amused when somebody announces that they're having a geek dinner at a technology conference. I mean, at a conference like that, every dinner is a geek dinner. The geek density is so high, +4 enchanted vorpal swords quiver in fear. [Update 8am: Fixed broken permalink. Yay, they broke a permalink...]
What is the maximum number of timers a program can create?
As MSDN correctly notes, "Timers are a limited global resource." How limited are they? (We're talking about timers created by .) Not as limited as they once were. Originally, there were eight timers total for the entire system. When there are only eight timers, you have to be very careful not to waste them and to destroy them when they aren't needed. Windows 3.0 increased this to 32. Windows 95 increased this to around 2500, although the debug version of Windows got mad at you if a single program created more than 32. Windows NT 3.1 would create timers until you exhausted the desktop heap...
The way to stop people from copying files to a folder is to use NTFS security, not to block drag/drop
A customer wanted to prevent users from copying files to certain locations, and they did it by hooking functions like and failing the operation if the parameters were not to its liking. The customer found that the hooks stopped working in Windows Vista because Explorer in Windows Vista uses the new COM interface instead of using the old function. The customer wanted assistance in getting their hook working again so they could prevent users from copying files to directories they wanted to block. Well, first of all, arbitrary function hooking is not supported by any version of Windows, so the customer was alrea...
In Ephesus, you juggle or die
In 1987, The Flying Karamazov Brothers performed their interpretation of Shakespeare's A Comedy of Errors. When I watched this show (part 1, part 2) when it first aired, it was my introduction both to the juggling team and to the play. It also reinforced my impression that Shakespeare was meant to be performed and not merely read. The jokes simply don't work as well when you merely read them. For some reason, I still remember the tiny juggling mishap in the final seconds of the show (part 2, time code 1:05:14): The actress at the far left edge of the screen (Luciana) drops a pin but covers up t...
Meta-content: Suggestion Box 4 will open sometime next year
Yesterday, I finished composing the last entry taken from an item in Suggestion Box 3. My prediction that the backlog would clear in early 2010 was off by exactly one year: The last Suggestion Box 3 entry is scheduled to be posted on January 3, 2011. I figure I'll open Suggestion Box 4 sometimes next year. But I'll leave it open for only a little while, to avoid the problem with Suggestion Box 3 where I left it open for so long that it took six years to clear out. (Then again, maybe I should stick to a six-year cycle for emptying the Suggestion Box. That would certainly discourage people fr...
My phone just DoS'd my office network
The other day I was working in my office minding my own business when I suddenly lost network connectivity. I couldn't contact any machines other than the ones in my office. When this happens, I go through some basic troubleshooting steps. Is my neighbor's network okay? How about power-cycling the affected machines? Refreshing the TCP/IP security policies? None of that seemed to work, so I called the network helpdesk, on the assumption that my port was shut down because I somehow missed an e-mail message announcing a mandatory security patch that I had failed to keep up with. My office has an IP phone. It's har...
City noises and their effects on songbirds
Robins in Sheffield sing at night because it's too noisy in the daytime. That reminds me that when I was in Antigua, Guatemala, I was told that the songbirds in the city have started mimicking car alarms. Apparently this is also happening in Oregon with birds mimicking car alarms and cell phone ring tones.
The operating system doesn't know which language programs are written in – by the time the code hits the CPU, they all look the same
Reader Will Rayer asks about "the degree to which 'plain vanilla' C Windows API code works under Vista with the native look and feel." It works just as well as code written in any other language. The operating system doesn't know which language programs are written in. By the time the code reaches the CPU, they all look the same. It's just a bunch of instructions that occasionally call an API function. You can write it in C, C++, assembly, Delphi, Perl, whatever. Of course, some languages are better-suited to calling Win32 than others. Win32 is a C-based API, in the sense that the way you call an exported fu...