The Old New Thing

Why do NTFS and Explorer disagree on filename sorting?

Some people have noticed that NTFS automatically sorts filenames, but does so in a manner different from Explorer. Why is that? For illustration purposes, I created files with the following names: And here's the sort order for various scenarios, at least on my machine. (You'll later see why it's important whose machine you test on.) First...

Why can't the default drag/drop behavior be changed?

A common reaction to my explanation of whether dragging a file will result in a move or copy was that there should be a setting that lets you change the algorithm by which Explorer decides whether you want to move or copy. There are a few reasons why this is a bad idea. First, if there were such a setting, then it removes some of the ...

If strncpy is so dangerous, why does Visual Studio 2005 still support it?

In response to the news that is so dangerous, at least one person has called for Visual Studio to revoke support for such a dangerous function, considering the continued support for the function grounds for holding the compiler manufacturer liable for any defects in programs compiled with that compiler. Well, for one thing, while it's true...

Using /LARGEADDRESSAWARE on 64-bit Windows for 32-bit programs

Probably the biggest advantage of 64-bit Windows is not the larger registers but rather the expansive 64-bit address space. Recall that even when the /3GB switch is set, 32-bit programs receive only 2GB of address space unless they indicate their willingness to cope with addresses above 2GB by passing the /LARGEADDRESSAWARE flag. This flag ...

Why are DLLs unloaded in the "wrong" order?

When a program starts or when a DLL is loaded, the loader builds a dependency tree of all the DLLs referenced by that program/DLL, that DLL's dependents, and so on. It then determines the correct order in which to initialize those DLLs so that no DLL is initialized until after all the DLLs upon which it is dependent have been initialized. (Of...

You can't escape those AOL CDs

One of my colleagues was unpacking one of those $30,000 quad-processor more-memory-than-you-know-what-to-do-with super-server computers. The kind that require their own electrical substation. And it came with an AOL CD. It's like buying a Lexus and finding a 35-cents-off coupon in the glove compartment. Apparently, one of the questions AOL ...

Another dead computer: My personal laptop

I'm kind of surprised at how much people reacted to my previous dead computer story. I guess there's an audience for stories about dead computers. Today's dead computer is my Sony Vaio PCG-Z505LE laptop, with a 600MHz processor and 192MB of RAM. Certainly a big step up from that 486/50 with 12MB of RAM. Laptop computers have a comparatively...

There's an awful lot of overclocking out there

A bunch of us were going through some Windows crashes that people sent in by clicking the "Send Error Report" button in the crash dialog. And there were huge numbers of them that made no sense whatsoever. For example, there would be code sequences like this: Yet when we looked at the error report, the and registers were equal! There were...