The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Jul 6, 2006
Post comments count 0
Post likes count 0

Nearly 20 percent of daily smokers say they exercise three or more times a week

Raymond Chen

Several months ago, The Seattle Times ran a story on people who smoke and also work out. In the article, personal trainer Will Baldyga compares it to other dissonant behavior such as pigging out on ice cream after a workout. I have to admit that on rare occasions, I lapse into such behavior ("justifying" bad eating habits with exercise), but on the whole, I manage to keep myself honest.

Jul 6, 2006
Post comments count 0
Post likes count 0

Is the maximum size of the environment 32K or 64K?

Raymond Chen

There appears to be some confusion over whether the maximum size of the environment is 32K or 64K. Which is it? Both. The limit is 32,767 Unicode characters, which equals 65,534 bytes. Call it 32K or 64K as you wish, but make sure you include the units in your statement if it isn't clear from context.

Jul 5, 2006
Post comments count 0
Post likes count 0

Retail companies allegedly not collecting personal information as aggressively

Raymond Chen

Several months ago, The Washington Post reported that retail companies were no longer collecting personal information as aggressively. The poster child for this sort of thing was RadioShack, which demanded your name and address even if you just stopped in to buy a pack of AA batteries. I didn't shop there often, and when I did, I merely refused to give them any information about myself. At the store near Microsoft main campus, after going through this exercise, the cashier eventually entered my name as "Cash" and out came the receipt: James Cash 123 Main St Redmond, WA 98052 Thank You, James Cash, for shopp...

Jul 4, 2006
Post comments count 0
Post likes count 1

Things I've written that have amused other people, Episode 2

Raymond Chen

Go figure.

Jul 3, 2006
Post comments count 0
Post likes count 0

How do you use the bike rack on a Metro bus?

Raymond Chen

While it's true that I often ride the bus and often ride my bicycle, I do not often ride my bicycle onto a bus. This means that I forget how it's done and have to refresh my memory. Fortunately, Arlington Transit uses the same bike rack design as we do here in Metro King County, so I can refer to their detailed pictures instead of our diagrams which leave a bit to be desired. It's not that hard, really. There are instructions on the rack itself for most of the steps. You squeeze the handle where it says "pull here", lower the rack, place the front tire where it says "front tire", the back tire where it says ...

Jul 3, 2006
Post comments count 0
Post likes count 1

Security: Don't forget to initialize the stuff you don't care about

Raymond Chen

Lost in excitement of privilege escalation vulnerabilities is the simple information disclosure through missing garbage initialization. Everybody should by now be familiar with the use of the function to ensure that buffers that used to contain sensitive information are erased, but you also have to zero out buffers before you write their contents to another location. Consider, for example, the following binary format: Code that writes out one of these files might go like this: Do you see the security bug? If the comment is shorter than 255 characters, then the bytes after the terminating null consist of...

Jun 30, 2006
Post comments count 0
Post likes count 0

Congratulations, Montréal, on finally paying for the 1976 Olympic Games

Raymond Chen

Assuming everything went according to plan, Montréal today made the final payment on Olympic Stadium (or Le Stade Olympique), originally built for the 1976 Olympic Games, and nicknamed "The Big O" (or "The Big Owe", if you prefer). Before you snicker, at least you have to give them credit for keeping the stadium until it was paid off. The Seattle Kingdome opened just a few months before Montréal's Olympic Stadium, but we demolished it in 2000 even though we will still be paying for it until 2012.

Jun 30, 2006
Post comments count 0
Post likes count 0

2006 mid-year link clearance

Raymond Chen

A few random links that I've collected.

Jun 29, 2006
Post comments count 0
Post likes count 0

Generating tooltip text dynamically

Raymond Chen

Our multiplexed tooltip right now is displaying the same string for all items. Let's make it display something a bit more interesting so it's more obvious that what we're doing is actually working. Instead of providing fixed tooltip text, we generate it on the fly by setting the text to and producing the text in response to the notification. The technique of generating tooltip text dynamically is useful in scenarios other than this. For example, the tooltip text may change based on some state that changes often ("Back to <insert name of previous page>") or the tooltip text may be slow or expensive to ...