The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

News flash: Work-at-home job offers are mostly just scams
Jan 10, 2012
Post comments count 0
Post likes count 0

News flash: Work-at-home job offers are mostly just scams

Raymond Chen
Raymond Chen

McClatchy Newspapers discovers, to everyone's surprise, that work-at-home job offers are mostly just scams. Of course, this is something Rob Cockerham discovered years ago. (He also has a rundown of all his articles on the subject, in case you haven't gotten enough.)

You can use backups for things other than restoring
Jan 10, 2012
Post comments count 0
Post likes count 0

You can use backups for things other than restoring

Raymond Chen
Raymond Chen

A customer wanted to know the internal file format of Visual SourceSafe databases. (That wasn't the actual question, but I've translated it into something equivalent but which requires less explanation.) They explained why they wanted this information: We are doing some code engineering analysis on our project, so we need to extract data about every single commit to the project since its creation. Things like who did the commit, the number of lines of code changed, the time of day... We can then crank on all this data to determine things like What time of day are most bugs introduced? and possibly even try ident...

From the research journal Duh: To lose weight, eat less
Jan 9, 2012
Post comments count 0
Post likes count 0

From the research journal Duh: To lose weight, eat less

Raymond Chen
Raymond Chen

Researchers have determined that the key to losing weight is to consume fewer calories. Okay, it's actually more interesting than the summary suggests. The researchers compared a variety of different popular diets and found that it didn't matter what diet you were on; the weight loss (and regain) was the same. The controlling factor was how many calories you consumed.

What were some of the abandoned features of Explorer back in its prototype days?
Jan 9, 2012
Post comments count 0
Post likes count 0

What were some of the abandoned features of Explorer back in its prototype days?

Raymond Chen
Raymond Chen

Chris asked for some stories about what Explorer was like in the early days. Well, one thing is that the original name of Explorer was Cabinet, continuing the folder/document metaphor by taking all your folders and documents and putting them inside a virtual filing cabinet. (Cabinet was viewed as an update to the Windows 3.1 File Manager program, whose icon as we all know was a filing cabinet.) Some remnants of this old name can be found in places like the structure. (Note that this old sense of Cabinet is unrelated to the CAB file format, which is also called Cabinet.) In the early versions of Cabinet,...

It must totally suck to live near Abbey Road
Jan 6, 2012
Post comments count 0
Post likes count 0

It must totally suck to live near Abbey Road

Raymond Chen
Raymond Chen

I feel sorry for the people who live near Abbey Road or who have to take that road as part of their daily routine, because tourists keep blocking traffic to recreate the cover of the eponymous Beatles album. The recording studio has a webcam on the intersection so you can watch the mayhem as it happens. Update: Just this morning, I checked out the webcam and within two minutes, another group of tourists posed in the zebra crossing.

Why did HeapFree fail with ERROR_POSSIBLE_DEADLOCK?
Jan 6, 2012
Post comments count 0
Post likes count 0

Why did HeapFree fail with ERROR_POSSIBLE_DEADLOCK?

Raymond Chen
Raymond Chen

A customer reported that they were receiving some assertion failures because the function was failing with what they believed to be a valid heap block, and the function reported that the reason for failure was . What's going on? One of my colleagues asked the psychic question, "Is the process exiting?" "Why yes, in fact it is. How did you know?" Recall how processes exit. One of the first things that happens is that all the other threads in the process are forcible terminated, which has as a consequence that any synchronization resources owned by those threads are now orphaned. And in this case, the synchro...

A joke for mathematicians: On the Weyl schism
Jan 5, 2012
Post comments count 0
Post likes count 0

A joke for mathematicians: On the Weyl schism

Raymond Chen
Raymond Chen

In one of my mathematics classes, the professor noted (and freely admitted that the joke was not original with him), "There are essentially two groups of mathematicians: Those that have read Weyl and those that have not. And once you enter the first group, you will never be understood by anyone in the second group." I guess it's only funny to mathematicians.

When DLL_PROCESS_DETACH tells you that the process is exiting, your best bet is just to return without doing anything
Jan 5, 2012
Post comments count 0
Post likes count 1

When DLL_PROCESS_DETACH tells you that the process is exiting, your best bet is just to return without doing anything

Raymond Chen
Raymond Chen

When the function receives a reason code of , the increasingly-inaccurately-named parameter to is used to indicate whether the process is exiting. And if the process is exiting, then you should just return without doing anything. No, really. Don't worry about freeing memory; it will all go away when the process address space is destroyed. Don't worry about closing handles; handles are closed automatically when the process handle table is destroyed. Don't try to call into other DLLs, because those other DLLs may already have received their notifications, in which case they may behave erratically in the same...

Misleading advertisement: Passports or green cards?
Jan 4, 2012
Post comments count 0
Post likes count 0

Misleading advertisement: Passports or green cards?

Raymond Chen
Raymond Chen

I happened to spot an online advertisement for a company that will help you enter the lottery for a United States Permanent Resident Card, commonly known as a Green Card (even though they card isn't green any more). The advertisement was illustrated with a picture of a United States passport. Um, a Green Card is not the same as a passport, nor does a Green Card authorize you to obtain a passport. Passports are for citizens, not alien permanent residents.