The Old New Thing

A warning to people averse to code

This is going to be a code-heavy week. People who are averse to code may want to just lie low until next week. I'll try to make it up by having next week be more storytelling-focused...

How much do you expect from a framework layer?

If a framework exposes functionality provided by a lower layer, how hard should the framework try to insulate you from all the quirks and limitations of the lower layer? Instinctively, of course, you would say, "The framework should insulate me completely." But be careful what you ask for. If a ...

Returning values from a dialog procedure

For some reason, the way values are returned from a dialog procedure confuses people, so I'm going to try to explain it a different way. The trick with dialog box procedures is realizing that they actually need to return two pieces of information: ...

Why are companies so worried about retraining costs?

Remember, most people do not view the computer as a world to be explored. It is merely a means to an end. So they learn the five steps they need to follow, and if they can't do them, they get stuck. "I hit Alt+Tab like I always do, to switch to another program, but instead of switching, this strange window...

An anecdote about improper capitalization

I've already discussed some of the strange consequences of case-sensitive comparisons. Joe Beda mentioned the Internet Explorer capitalization bug that transformed somebody's name into a dead body. Allow me to elaborate. You might learn something. This bug occurred ...

Just follow the rules and nobody gets hurt

You may have been lazy and not bothered calling VirtualProtect(PAGE_EXECUTE) when you generated some code on the fly. You got away with it because the i386 processor page protections do not have a "read but don't execute" mode, so anything you could read you could also execute. Until...

The long and sad story of the Shell Folders key

When you are attempting to architect an operating system, backwards compatibility is one of the ones you just have to accept. But when new programs rely on app hacks designed for old programs, that makes you want to scream. Once upon a time, in what seems like a galaxy far far away (a Windows 95 beta release known as "M3"), we documented a...