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

First, try reading the error message, episode 3: Even programmers see error messages without reading them

As we all know, users don't read error messages. And, sad to say, this behavior extends to the group of people you would think pay the most attention to error messages, namely, programmers, who are the people who cause your computer to display the error messages! Today's example comes from an internal programmer's tool which I will call Program Q. I'm trying to back out an update I made to record 19 of our table (which was entered as transaction 512), but I can't get it to work: What is the problem here, and how do I fix it? The transaction couldn't be backed out because somebody else made a chan...

Why does it take longer to reject an invalid password than to accept a valid one?

You may have noticed that it takes longer to reject an invalid password than to accept a valid one. There are a few reasons for this. First of all, it simply takes longer to confirm that a password is invalid. Your local computer retains a password cache. This password cache improves performance of local authentication operations, such as unlocking a workstation. If you unlock the workstation with the same password you used to log on, then the password is assumed to be good. This allows the workstation to unlock quickly. Without the password cache, unlocking the workstation would require going back to the dom...

Germans are falling for the same trap as the Japanese: Importing words from English and changing the meaning, but the Germans do it even though the words didn't need to be imported at all

Languages borrow from each other all the time. English has historically been a happy perpetrator of word-theft, but in recent decades, it has been serving as the source for a lot of theft, too. What I find particularly interesting, though, is when a word is borrowed and given a meaning in its new language different from its meaning in the source language. Japanese is famous for this, For example, they take the English phrase white shirt and import it as waishatsu, which means not white shirt but dress shirt. In Swedish, the phenomenon of importing English into Swedish is known as svengelska, a blend of svenska ...

Why does SHFileOperation have internal error codes for DVD?

Because that's what you do when DVDs show up.

How many days long is a one-day sale? The answer might surprise you

A friend of mine received a flyer for a major department store proudly proclaiming that they were having a One-Day-Only sale. Sale prices were in effect on Saturday and Sunday. Previously on the subject For large values of 1. If this keeps up, I may have to create a subcategory for it.

How does delay-loading use binding information?

In the documentation for delay-loading, there's a remark that says that the call to can be avoided if there is binding information. A customer who received the explanation of why you can't delay-load pointed out that paragraph and asked whether this means that you can delay-load if you bind to it. (Getting around to answering this question was the point of the past few days.) Let's take another look at what that -avoidance optimization does. Actually, it's just another look at what the module loader does when it's time to resolve imports to a bound DLL: At build time, the actual function pointers are pre...

What is DLL import binding?

Last time, we saw how hinting is used to speed up the resolving of imported functions. Today, we'll look at binding. Recall that the module loader resolves imports by locating the function in the export table of the linked-to DLL and recording the results in the loaded module's table of imported function addresses so that code from the module can jump indirectly through the table and reach the target function. One of the consequences of this basic idea is that the table of imported function addresses is written to at module load time. Writeable data in a module is stored in the form of copy-on-write pages....

What is DLL import hinting?

Binding and hinting are two types of optimizations to improve the load-time performance of a module (executable or DLL). We'll start with hinting, then look at binding, and then look at how it affects delay-loading. The import table for a module contains a list of DLLs and a list of functions from that DLL which the module wishes to link to. The basic idea is that for each target DLL, the linker loads the DLL and then obtains the address of each imported function and from that DLL, records the results in the loaded module's table of imported function addresses. Hinting is a technique for speeding up this look...

Raymond's highly scientific predictions for the 2010 NCAA men's basketball tournament

Once again, it's time for Raymond to come up with an absurd, arbitrary criterion for filling out his NCAA bracket. This year, we go to the well-known dispute arbiter Google Fight. The criterion is the number of Google hits for the quoted phrase "%s basketball", divided by the school's seed. (I would have used Bing hits, except Bing's numbers are highly erratic. Only 291 hits for "Arkansas-Pine Bluff basketball"? The results may be more meaningful, but I'm not looking for meaningful results; I'm looking for numbers I can plug into my bracket-o-matic.) Once the field has been narrowed to eight teams, the result...