The Old New Thing

A rant against flow control macros

I try not to rant, but it happens sometimes. This time, I'm ranting on purpose: to complain about macro-izing flow control. No two people use the same macros, and when you see code that uses them you have to go dig through header files to figure out what they do. This is particularly gruesome when you're trying to debug a problem with ...

Computing the size of a directory is more than just adding file sizes

One might think that computing the size of a directory would be a simple matter of adding up the sizes of all the files in it. Oh if it were only that simple. There are many things that make computing the size of a directory difficult, some of which even throw into doubt the even existence of the concept "size of a directory". Reparse ...

You can create an infinitely recursive directory tree

It is possible to create an infinitely recursive directory tree. This throws many recursive directory-traversal functions into disarray. Here's how you do it. (Note: Requires NTFS.) Create a directory in the root of your C: drive, call it C:\C, for lack of a more creative name. Right-click My Computer and select Manage. click on the Disk ...

Sometimes people don’t like it when you enforce a standard

Your average computer user wouldn't recognize a standards document if they were hit in the face with it. I'm reminded of a beta bug report back in 1996 regarding how Outlook Express (then called "Microsoft Internet Mail and News") handled percent signs in email addresses (I think). The way Outlook Express did it was standards-conformant, ...

Excellent blog about Windows and Unicode

Michael Kaplan has probably forgotten more about Unicode than most people know. He knows about the mysterious placement of the Won character in the Korean character set, and the same for the Japanese Yen character, what the invariant locale is, why Korean text sorts strangely if you pass the NORM_IGNORENONSPACE flag, and other strange and...

How to get more hits on Google than even Steve Ballmer

Ein deutscher Blogger namens Tony schrieb dass Robert Scoble is gaining on Steve Ballmer. Mit anderen Worten, dass eine Google-Suche nach "Robert Scoble" ungefähr 172.000 Seiten findet, während eine Google-Suche nach "Steve Ballmer" ungefähr 302.000 Seiten zeigt. Er fragte, ob jemand einen anderen Microsoft-Angestellten finden...

Why doesn’t the RunAs program accept a password on the command line?

The RunAs program demands that you type the password manually. Why doesn't it accept a password on the command line? This was a conscious decision. If it were possible to pass the password on the command line, people would start embedding passwords into batch files and logon scripts, which is laughably insecure. In other words, the ...