The Old New Thing

Why is processor affinity inherited by child processes?

Consider why a typical program launches child processes. (Shell programs like Explorer aren't typical.) It's because the task at hand is being broken down into sub-tasks which for whatever reason has been placed into a child process. An Example of this would be, say, a multi-pass compiler/linker, where each pass is implemented as a separate ...

When people ask for security holes as features: Silent install of uncertified drivers

Probably the single greatest source of bluescreen crashes in Windows XP is buggy device drivers. Since drivers run in kernel mode, there is no higher authority checking what they're doing. If some user-mode code runs amok and corrupts memory, it's just corrupting its own memory. The process eventually crashes, but the system stays up. On ...

On being attacked by a sidewalk

Yesterday, I was attacked by a sidewalk. I was cycling from work to a friend's house for dinner and was northbound in the shoulder on 172nd Ave NE in Redmond. As I reached the intersection with NE 138th St., I was momentarily distracted, perhaps by my water bottle, I forget. This lapse of attention resulted in my failing to notice...

The poor man’s way of identifying memory leaks

There is a variety of tools available for identifying resource leaks, but there's one method that requires no tools or special compiler switches or support libraries: Just let the leak continue until the source becomes blatantly obvious. Nightly automated stress testing is a regular part of any project. Some teams use screen savers as the ...

Adding a lookup control to the dictionary: Searching Pinyin

Finally we start searching. For now, the search algorithm is going to be very simple: The string you type into the edit control will be treated as the start of a Pinyin word or phrase. We'll make it fancier later. Here is where a lot of the groundwork (some of which I called out explicitly and some of which I slipped in without calling ...

Adding a lookup control to the dictionary: Just getting it on the screen

When we last left the dictionary project, we were able to display the dictionary entries but hadn't yet gotten around to searching it. Today, we'll place the lookup control, though we won't hook it up until next time. First, we give the edit control an ID and create some member variables to keep track of it. class RootWindow : public ...

Why is Windows Error Reporting nicknamed “Dr. Watson”?

The nickname for the feature known as Windows Error Reporting is "Dr. Watson". Where did that name come from? As you have probably guessed, The name Dr. Watson was inspired by the character of Dr. Watson, the assistant to Sherlock Holmes in the stories by Arthur Conan Doyle. It is my understanding that the doctor was ...

How can a company get access to Windows Error Reporting data?

What happens to all the crashes in programs not written by Microsoft that are submitted via Windows Error Reporting? Microsoft still collects and indexes them, and vendors can sign up to gain access to the error reporting database to see the crashes in their programs. The service is free, although it does require a Verisign ID so that the ...

That’s about the size of it

News reporters seem to have some difficulty reporting the size of things. In order to make things more accessible to their readers, they try to compare it to the size of an everyday object, but to me it seems they try a bit too hard. For example, this story about the recent rescue of the crew of a sunken submarine noted, [T]he layers of ...