The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Jan 2, 2009
Post comments count 0
Post likes count 0

Kids love cake, but that doesn’t make them good judges of cake

Raymond Chen

My friend who got married last year went to the Seattle Wedding Show (here are some pictures from the 2007 show courtesy of a vendor's blog) and, through a series of circumstances not relevant to the story, combined the visit with a brief stint of babysitting for her nieces, one a tomboy and the other a girly-girl. The children's father came to pick them up after a half hour, but that half hour at the wedding show was quite exciting for two little girls. It was hardly surprising that the "I want to be a princess when I grow up" girly-girl would be completely enthralled by the wedding show. What was unexpected w...

Jan 2, 2009
Post comments count 0
Post likes count 1

Why doesn’t Windows 95 format floppy disks smoothly?

Raymond Chen

Welcome, Slashdot readers. Remember, this Web site is for entertainment purposes only. Who spends all day formatting floppy disks? From the reaction of geekdom, it appears that there are lots of geeks who sit around formatting disks all day. (Psst, you can buy them pre-formatted.) But why did Windows 95 get all sluggish when you formatted a floppy disk? It's that pesky MS-DOS compatibility again. As we saw a while ago, MS-DOS acted as the 16-bit legacy device driver layer for Windows 95. Even though the operation was handled by the 32-bit file system, all I/O calls were routed through 16-bit code...

Jan 1, 2009
Post comments count 0
Post likes count 0

Follow-up: A new DUI record set in the state of Washington

Raymond Chen

A year ago, I noted that a new DUI record had been set for the state of Washington. It took a while, but the story finally settled out. Recapping the story so far (links in the original article): The driver's attorneys eventually succeeded in having her released from jail (where she had been held on $300,000 bail) to a treatment center. In April 2008, the driver pled guilty to driving while intoxicated and in June 2008 was sentenced to one year in prison for that offense, plus additional days for other offenses, totalling 440 days in jail; plus 90 days of electronic home monitoring, fines, attendance at a...

Jan 1, 2009
Post comments count 0
Post likes count 1

How do I write a program that can be run either as a console or a GUI application?

Raymond Chen

You can't, but you can try to fake it. Each PE application contains a field in its header that specifies which subsystem it was designed to run under. You can say to mark yourself as a Windows GUI application, or you can say to say that you are a console application. If you are GUI application, then the program will run without a console. The subsystem determines how the kernel prepares the execution environment for the program. If the program is marked as running in the console subsystem, then the kernel will connect the program's console to the console of its parent, creating a new console if the parent doe...

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

2008 year-end link clearance

Raymond Chen

Time for the semi-annual link clearance. Finally, we have the traditional plug for my column in TechNet Magazine:

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

Sorry, I don’t get calls on this phone often

Raymond Chen

Many years ago, I was in a small meeting: It consisted of the project manager, me, and one other person. Just a quick little status meeting to discuss how things were going. We were a few minutes into the meeting when the project manager's cell phone rang. Now, this was back in the days before cell phones were ubiquitous. They were pretty spendy gadgets; pulling out your shiny $400 Nokia 8810 was an ostentatious move, allowing you to demonstrate your alpha position in the social hierarchy. Anyway, when the cell phone rang, the project manager answered it and started talking. After a little while, it became...

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...