The Old New Thing

Don't trust the return address, no really

In the discussion of how to prevent non-"trusted" DLLs from using private OS resources, more than one person suggested having the or function behave differently depending on who the caller is. But we already saw that you can't trust the return address and that you definitely shouldn't use the return address to make a security decision (...

Computer monitors float, screen upwards

Oceanographer Curtis Ebbesmeyer made another appearance on my local public radio station. Among the ocean garbage trivia is the fact that computer monitors float screen upwards (timecode 4:00). Other fascinating facts...

Accessibility is not just for people with disabilities

When the topic of accessibility comes up, most people think it's all about people with disabilities. While it's true that people with disabilities were the original target audience for accessibility, more recent developments have highlighted the value of accessible technologies to everyone. For one thing, making your program accessible means ...

Cool web site: Bill Monk

One of my friends introduced me to Bill Monk, which is like PayPal but without the money. You and your friends sign up, and then you can let the site keep track of who owe whom how much. Of course, whether this is useful to you depends on how you and your friends actually deal with money and small debts. With some of my friends, we use the...

Do not change program semantics in the debug build

What you don't want is a problem that goes away when you debug it. It is expected that a program have additional debugging code inside blocks. After all, that's why it's a debug build. But what you definitely don't want to do is have that debugging to fundamentally change the program's behavior. You can perform additional validation. You ...

The cultural anthropology of getting on a bicycle

I can tell where you grew up by watching you get on a bicycle. Well, sort of. In my limited experience, I've observed two distinct ways of getting on a bicycle. The first is what I'll call the Chinese method, since it's the dominant technique in China, Taiwan, and Japan, as far as I can tell. To get on a bicycle using the Chinese method, ...

Why can't I see all of the 4GB of RAM in my machine?

Here's a question that came from a customer: I have set my boot options to /3GB /NOPAE. Even though the server has 4GB of physical memory, we see only 3.5GB of physical memory on the server after it boots up. However, when we change the boot options to /PAE, we can observe 4GB of memory. Furthermore, when I enable only /PAE, even though the ...

Why does SetWindowsHookEx take an HINSTANCE parameter?

An anonymous commenter asked why the function takes an parameter if the first thing it's going to do is convert the instance handle into a file name. Because that's not how it worked in 16-bit Windows. In 16-bit Windows there was no such thing as hook injection. All 16-bit Windows applications ran in the same address space, so there was ...