The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Sensor development kits were flying off the shelves
Nov 3, 2008
Post comments count 0
Post likes count 0

Sensor development kits were flying off the shelves

Raymond Chen
Raymond Chen

After the Sensor and Location Platform PDC presentation, people were stopping by the booth and grabbing sensor hardware and development kits like they were candy. Then again, to geeks, this stuff is candy. (And technically, they weren't flying off shelves. They were flying out of bins. Well, and technically they weren't flying either.) Other notes from the last day of the 2008 PDC:

If there’s already a bug, it’s not surprising that there’s a possibility for error
Nov 3, 2008
Post comments count 0
Post likes count 0

If there’s already a bug, it’s not surprising that there’s a possibility for error

Raymond Chen
Raymond Chen

It's great to think about all the things that can go wrong but you also have to think about the situations that could lead to those bad things. In particular, you have to recognize when you are trying to avoid a bug that is ultimately outside your component and which you can't fix anyway. For example, consider this multithreaded race condition: Why is used in the implementation of ? The only reason I can think of is for multithread safety. But that function doesn't look multithread safe—what if another thread was about to increment ? Does the refcount incrementer have a special interlocked check fo...

Stick to the normal candy and nobody gets hurt
Oct 31, 2008
Post comments count 0
Post likes count 0

Stick to the normal candy and nobody gets hurt

Raymond Chen
Raymond Chen

Hallowe'en is a family affair at Microsoft. It typically starts at around 3 or 4 o'clock, with costumed kids roaming the hallways collecting treats from offices. One year, one of my colleagues decided that the kids deserved more than the usual candy bars and chocolates. Even though he is Caucasian, he went to the local Asian foods market and stocked up on all sorts of Asian candies. Lychee-flavored gelatin, rice crackers, spiced watermelon seeds, you name it. It's a holiday and a cultural learning experience. He dumped all the candies into a big bowl and set them out for the kids. The kids didn't quite know w...

Working with ambiguous and invalid points in time in managed code
Oct 31, 2008
Post comments count 0
Post likes count 0

Working with ambiguous and invalid points in time in managed code

Raymond Chen
Raymond Chen

Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. I pointed out some time ago that Win32 and .NET deal with daylight saving time differently. Specifically, Win32 always deals with the time zone you are currently in (even if it's not the time zone that corresponds to the timestamp you are manipulating), whereas .NET deals with the time zone that was in effect at the time the timestamp was generated. For more details on the latter, I refer you to Josh Free from the BCL Team Blog, who some time ago explained how to work with ambiguous and invalid points i...

Dude, the admission bracelet goes around your wrist
Oct 30, 2008
Post comments count 0
Post likes count 0

Dude, the admission bracelet goes around your wrist

Raymond Chen
Raymond Chen

Short stories from the 2008 PDC: Bonus chatter added 9am:

If you’re going to reformat source code, please don’t do anything else at the same time
Oct 30, 2008
Post comments count 0
Post likes count 0

If you’re going to reformat source code, please don’t do anything else at the same time

Raymond Chen
Raymond Chen

I spend a good amount of my time doing source code archaeology, and one thing that really muddles the historical record is people who start with a small source code change which turns into large-scale source code reformatting. I don't care how you format your source code. It's your source code. And your team might decide to change styles at some point. For example, your original style guide may have been designed for the classic version of the C language, and you want to switch to a style guide designed for C++ and its new // single-line comments. Your new style guide may choose to use spaces instead of tabs f...

PDC 2008 notes: How to get to room 406A, and other notes
Oct 29, 2008
Post comments count 0
Post likes count 0

PDC 2008 notes: How to get to room 406A, and other notes

Raymond Chen
Raymond Chen

Today is the day of my talk. I'm always a bit nervous before these things, because I'm never sure if what I'm going to present matches up with what people are expecting. Most people who come to my PDC talk don't know who I am, so they aren't expecting me to toss out a few catch phrases, use my psychic powers, and tell stories about how a bug in a 16-bit scanner driver written in 1993 is the reason why TCP/IP is so complicated. (That last part was a parody.) Today's notes:

Why does my Run dialog say that tasks will created with administrative privileges?
Oct 29, 2008
Post comments count 0
Post likes count 0

Why does my Run dialog say that tasks will created with administrative privileges?

Raymond Chen
Raymond Chen

"I don't know what happened, but now when I open the Run dialog on my Windows Vista machine by typing Windows+R, there is a shield under the edit box that says This task will be created with administrative privileges. What's going on?" One my colleagues used psychic powers to solve this problem: "I imagine that you manually killed Explorer, and then you used an elevated command prompt or an elevated Task Manager to launch a new one. An elevated Explorer shows this message. To fix it, exit your elevated Explorer, and exit your running elevated copy of Task Manager (if any). Then type Ctrl+Alt+Esc to launch a nor...

Typo patrol at the 2008 PDC
Oct 28, 2008
Post comments count 0
Post likes count 0

Typo patrol at the 2008 PDC

Raymond Chen
Raymond Chen

Typo patrol got off to a very quick start. One of the flyers in the attendee goodie bag is from a company which offers two free months of service to PDC attendees. The first step in obtaining the service is "Just signup and mention the PDC by January 31, 2008." Okay, just hang on while I fire up my time machine. Bonus grammar typo: signup is a noun; sign up is a verb. The second typo is kind of important. In all the PDC documents (including the voucher to pick up your attendee goodie bag), it says to go to Kentia Hall. This is incorrect. If you try, you'll find a locked door. The goodie bags (and all oth...