The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

What does the “Zw” prefix mean?

If you spend time in kernel mode, you're accustomed to seeing functions with two-letter (or occasionally, three-letter) prefixes that indicate which component they belong to. What does the "Zw" mean? Answer: Nothing. The people who chose the letters wanted to pick something that was unlikely to collide with anything. Perhaps they had a prior bad experience with having chosen a prefix, only to find that somebody ahead of them claimed it already?

Spam trackback attack returns, it’s not a matter of whether but how much

Like microsoft.com, the question isn't whether blogs.msdn.com site is under attack but rather how bad the attack is right now. There are a number of regular culprits, like , , , but those sites tend to focus on the most recent few articles. A new category of trackback spammer is here: The I'm going to scrape your entire site and create a trackback for every article trackback spammer. I'm pretty sure this will continue for at least the next week. I think I'm going to have to write a script that auto-deletes all these bogus trackbacks.

Who you calling boring?

A notice was sent out by the real estate department with the provocative subject line Campus notification — Building 7: Marking Boring Locations. What? Were the people in the real estate department saying that the people who work in Building 7 need to get some new hobbies? Or maybe they were just going to put up markers like you see in historic districts, but the markers are going to say something like On this spot in 1998, absolutely nothing interesting happened. But no, that's not what the message was about. It was announcing that, in preparation for an expansion of the parking garage, the...

Whew, I’m not doing *that* again!

When I met Sara Ford at the 2008 PDC, I got to talk to her author-a-author. I asked her how the book-writing experience was. "I'm never doing that again!" she replied. Yeah, that's pretty much how I feel about it, too. Steve Makofsky agrees. (Though, to be fair, what Sara was not going to do was write a book in three months, as opposed to swearing off writing books entirely.) By the way, my book is now available in Chinese. I don't get any royalties when people buy a translated copy, so buy it or not, I don't care. Actually, I make barely any money from the book at all. During one six-month period, I ...

Why does the CreateProcess function modify its input command line?

One of the nasty gotchas of the function is that the parameter must be a mutable pointer. If you pass a pointer to memory that cannot be written to (for example, a pointer to a page that is marked ), then you might crash. Commenter Ritchie wonders why this parameter is so weird. Basically, somebody back in the 1980's wanted to avoid allocating memory. (Another way of interpreting this is that somebody tried to be a bit too clever.) The temporarily modifies the string you pass as the in its attempt to figure out where the program name ends and the command line arguments begin. Now, it could have made a ...

Lessons from the state police, like what to do when they pull you over

NPR's Noah Adams rides along with the Idaho State Police and learns the answers to questions like what you should do when you are pulled over, and why the first thing the officer does is touch your car.

Alternatives to using the #error directive to check whether the compiler even sees you

In response to my description of how you can use the #error directive to check whether the compiler even sees you, some commenters proposed alternatives. I never claimed that my technique was the only one, just that it was another option available to you. Here are some other options. scott suggested merely typing asdasdasd into the header file and seeing if you get an error. This usually works, but it can be problematic if the code does not already compile. And of course it doesn't compile, because the reason why you're doing this investigation in the first place is that you can't get your code to compile and...

An unexpected application of the First Law of Thermodynamics

This past winter, my furnace failed catastrophically. (The furnace repair person told me that when furnaces fail, it tends to be catastrophic failure.) It was a few days before everything was back in order, and the very day everything was working again, the furnace belonging to one of my relatives stopped working. This was an application of the First Law of Thermodynamics with which I had previously been unfamiliar. Fortunately, the repair on the second furnace was very simple and was done in just a few hours. After I informed my friends of my discovery of this law of the universe, one of them wrote, "Our...

I’m sorry, you don’t have permission to know where this shortcut file should show up in the Explorer window

Commenter Gabe suggested that the shortcut file should contain a bit that indicates whether the target of the shortcut is a folder, so that shortcuts to folders can sort with real folders. "That would allow them to sort properly without doing any additional work beyond that required to see its icon." (Commenter Josh agreed that "The performance reason doesn't really apply here, since explorer is already looking at the target to get the icon," rejecting commenter AndyC's argument that performance may have been a concern.) Well, first of all, shortcuts do remember whether the target is a file or a folder, or at...