The Old New Thing

Why do atoms start at 0xC000?

There are two types of atoms, so-called integer atoms, which are just small integers, and, um, atoms that don't have a special adjective; these plain vanilla atoms come from functions like . (For the purpose of this discussion, I'll call them string atoms.) The atom zero is invalid (); atoms 1 through † are integer atoms, and atoms from...

What happened to winipcfg and netmon?

Commenter Michael Moulton asks: Back in the Win95 & 98 days, we had winipcfg to manage DHCP leases on the client. Additionally, we had an app (I think it was netmon) to let you view people currently accessing your shares. Now, we have ipconfig on the command line and nothing like netmon. I'd be interested in hearing why those tools ...

Why do structures get tag names even if there is a typedef?

As we noted last time, structure tags are different from the typedef name as a historical artifact of earlier versions of the C language. But what about just leaving out the name entirely? One problem with this approach is that it becomes impossible to make a forward reference to this structure because it has no name. For example, if you ...

Why are structure names different from their typedef names?

In Windows header files, many structures are declared like this: Why is the structure name different from typedef name? This is a holdover from very early versions of the C language where structure tags, union tags, and typedefs were kept in the same namespace. Consequently, you couldn't say . At the open brace, the compiler registers ...

What's the difference between int and INT, long and LONG, etc?

When you go through Windows header files, you'll see types with names , , , and so on. What's the difference between these types and the uncapitalized ones? Well, there isn't one any more. What follows is an educated guess as to the story behind these types. The application binary interface for an operating system needs to be unambiguous. ...

Why can't I convert a time zone abbreviation into a time zone?

Suppose you have a string of the form . How can you parse this into something your program can manipulate, like say a or a ? Basically, you can't in the general case. The time zone abbreviation CST is ambiguous. It could mean U.S./Canada Central Standard Time, Australian Central Standard Time, China Standard Time, or Cuba Summer Time. ...

Why are process and thread IDs multiples of four?

On Windows NT-based operating systems, process and thread IDs happen always to be a multiple of four. Is this just a coincidence? Yes, it's just a coincidence, and you shouldn't rely on it since it is not part of the programming contract. For example, Windows 95 process and thread IDs were not always multiples of four. (By ...

Why does Ctrl+ScrollLock cancel dialogs?

Commenter Adam Russell asks why Ctrl+ScrollLock cancels dialogs. Easy. Because Ctrl+ScrollLock is the same as Ctrl+Break, and Ctrl+Break cancels dialogs. Okay, that answer actually raises two more questions. First, why is Ctrl+ScrollLock the same as Ctrl+Break? This is a consequence of the backward compatibility designed into the Enhanced ...