The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Aug 21, 2006
Post comments count 0
Post likes count 1

Sucking the exception pointers out of a stack trace

Raymond Chen

Often, you find yourself staring at a stack trace for a caught exception and want to see the original exception. (You too can get symbols for operating system binaries, either by using the symbol server to get the symbols on-demand or, if you have a gigabyte of disk space, you can download symbol packages to get them all at one go. Even if you go for the symbol package, you still need the symbol server, since it gets updated with symbols for binaries that have been updated since the most recent service pack.) Here, we caught an exception in the . What was the exception? Well, an exception filter receives ...

Aug 18, 2006
Post comments count 0
Post likes count 0

We encourage everyone to pack gel-filled bras in their checked baggage

Raymond Chen

My thanks to the Annals of Improbable Research for pointing out this recommendation from the TSA. I don't own a gel-filled bra, so I'll have to do some extra shopping before my next plane trip.

Aug 18, 2006
Post comments count 0
Post likes count 1

Applications and DLLs don't have privileges; users do

Raymond Chen

I can't believe you people are actually asking for backdoors. If an end user can do it, then so can a bad guy. In response to the requirement that all drivers on 64-bit Windows be signed, one commenter suggested adding a backdoor that permits unsigned drivers, using some "obscure registry key". Before somebody can jump up and shouts "security through obscurity!", the commenter adds this parenthetical: "(that no application has privileges to do by default)". What does that parenthetical mean? How do you protect a registry key from an application? And if applications don't have privileges to modify a key, then...

Aug 17, 2006
Post comments count 0
Post likes count 0

A modest proposal: On allowing mobile phones on airplanes

Raymond Chen

Ever since the FAA decided to reconsider its ban on the use of cellular phones on airplanes during flight, there has been quite a reaction over whether this is a good thing. To resolve this issue, I present this modest proposal. Remember back in the days when smoking was permitted on airplanes? When you bought a ticket, you were asked whether you wanted to be in the smoking or non-smoking section. We can do the same thing with mobile phones. You can ask to be seated in the "yapping" or "non-yapping" section. If you're in the yapping section, then yap all you want. Call your grandmother and talk with her the ...

Aug 17, 2006
Post comments count 0
Post likes count 1

Don't trust the return address, no really

Raymond Chen

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 (which is what these people are proposing). All attackers have to do is find some other "trusted" code to do their dirty work. For example, the function internally calls to locate the appropriate string bundle. Therefore, if attackers want to get a string resource from a "t...

Aug 16, 2006
Post comments count 0
Post likes count 0

Computer monitors float, screen upwards

Raymond Chen

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:

Aug 16, 2006
Post comments count 0
Post likes count 1

Accessibility is not just for people with disabilities

Raymond Chen

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 that test automation can manipulate your program in a uniform manner. They can enumerate the buttons, get text for them, press a button programmatically, and so on. Even if you don't use a standard button control but instead opt to go windowless, as long as you expose your ...

Aug 15, 2006
Post comments count 0
Post likes count 0

Cool web site: Bill Monk

Raymond Chen

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 "It'll all even out in the end" strategy. We'll take turns paying for dinner and events based on the "I think it's my turn" honor system. With another group of friends, the bills are neatly tabulated and reckonings sent out by email for settlement. They use this system sinc...

Aug 15, 2006
Post comments count 0
Post likes count 1

Do not change program semantics in the debug build

Raymond Chen

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 can raise assertion failures. You can track resources. It can be slower and consume additional resources, but you had better not alter code flow. This code is wrong: The debug version behaves fundamentally differently from the retail version. If somebody calls this functio...