The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Dec 30, 2008
Post comments count 0
Post likes count 0

Crazy or cell phone?

Raymond Chen

You've seen it, I'm sure. People walking down the street talking to themselves. Crazy or cellphone? What really gets me are the people who wear the headsets even when they aren't talking on the telephone, but rather in anticipation of receiving a telephone call. To those people, I have this to say to you: You're not that important. Get over yourself. I remember a few years ago, I was in Los Angeles attending a little party and got a ride home from somebody who was heading my way. We got in the car, and she put on her headset before putting the car in gear. It was a half-hour drive. No telephone call.

Dec 30, 2008
Post comments count 0
Post likes count 1

Every crash is a potential security vulnerability

Raymond Chen

Whenever I post about a programming error that can lead to crashes, the security team gets all excited and starts looking for ways to exploit it. For example, when I wrote about the fundamentally flawed flag, the security folks went scouring through the Windows source code looking for anybody who passed that flag, and then tried to come up with ways they could trick the code into loading an unintended DLL and causing trouble. I wouldn't have known about this exercise at all if one of the team members hadn't forwarded me some email discussing their preliminary investigations as if to say, "See what you starte...

Dec 29, 2008
Post comments count 0
Post likes count 1

Undecorating names to see why a function can’t be found

Raymond Chen

Here's a problem inspired by actual events. When I build my project, it compiles fine, but it fails during the link step with an unresolved external: program.obj : error LNK2001: unresolved external symbol "public: virtual wchar_t const * __thiscall UILibrary::PushButton::GetName(class UILibrary::StringHolder * *)" (?GetName@PushButton@UILibrary@@UAEPB_WPAPAVStringHolder@2@@Z) The function I'm trying to call exists in the source code for uilibrary.lib; I'm looking at it right now. And the definition in the source code matches the declaration in the header file: namespace UILibrary { ... class PushButt...

Dec 26, 2008
Post comments count 0
Post likes count 1

Why are all computers shown with a Printers folder even if printer sharing is disabled?

Raymond Chen

When you visited a computer on the network by typing into the address bar, Explorer showed you a Printers folder if the computer had printer sharing enabled. But starting in Windows Vista, the Printers folder is shown regardless of whether the remote computer is sharing any printers. Why did this change? Communicating with the remote computer to ask it about its printers simply took too long. The method returns an enumerator that produces a list of items in the folder. Think of it as the shell namespace version of . When the method is called, it must produce the next item in the folder or return a code...

Dec 25, 2008
Post comments count 0
Post likes count 1

Then again, sometimes the improvement is merely incremental

Raymond Chen

Several years ago, the security department sent out a company-wide memo: Over the next few months, we will be upgrading the card readers on all of our major campuses. The old card readers show a solid red light when the door is locked, whereas the new card readers show a blinking red light. Aw-right, a blinking light. Now we're cookin' with gas!

Dec 24, 2008
Post comments count 0
Post likes count 0

Foiled by my withered hand

Raymond Chen

A few years ago, some email was sent out to the product team asking for a volunteer hand model to demonstrate how to open the Windows Vista box. Alas, I withdrew myself from consideration due to my withered hand.

Dec 23, 2008
Post comments count 0
Post likes count 0

Misheard lyrics as applied to Christmas songs

Raymond Chen

While visiting my young nieces, we sang some Christmas songs, and when it came to sing Toyland, the four-year-old sang it with misheard lyrics: "Toi-let! Toi-let!"

Dec 23, 2008
Post comments count 0
Post likes count 1

Why isn’t there a SendThreadMessage function?

Raymond Chen

Here's an interesting customer question: Windows has and . It also has but no . Why isn't there a function? Am I forced to simulate it with an event? What would this imaginary function do? Recall that delivers the message directly to the window procedure; the message pump never sees it. The imaginary function would have to deliver the message directly to.... what? There is no "thread window procedure" to deliver it to. Okay, maybe you still intend to process the thread message in your message pump, but you want the caller of the imaginary function to wait until you've finished processing the messag...

Dec 22, 2008
Post comments count 0
Post likes count 1

On 64-bit Windows, 32-bit programs run in an emulation layer, and if you don’t like that, then don’t use the emulator

Raymond Chen

On 64-bit Windows, 32-bit programs run in an emulation layer. This emulation layer simulates the x86 architecture, virtualizing the CPU, the file system, the registry, the environment variables, the system information functions, all that stuff. If a 32-bit program tries to look at the system, it will see a 32-bit system. For example, if the program calls the function to see what processor is running, it will be told that it's running on a 32-bit processor, with a 32-bit address space, in a world with a 32-bit sky and 32-bit birds in the 32-bit trees. And that's the point of the emulation: To keep the 32-bit pr...