The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Sep 17, 2014
Post comments count 0
Post likes count 1

Poor man's comments: Inserting text that has no effect into a configuration file

Raymond Chen

Consider a program which has a configuration file, but the configuration file format does not have provisions for comments. Maybe the program has a "list of authorized users", where each line takes the form or , where is a group or user. For example, suppose we have that goes like this: This is the sort of file that can really use comments because people are going to want to know things like "Why does Bob have access?" One way of doing this is to embed the comments in the configuration file in a way that has no net effect. You can do this to add separator lines, too. Assuming that you don't have any u...

Sep 16, 2014
Post comments count 0
Post likes count 1

Microspeak: spend

Raymond Chen

Remember, Microspeak is not merely for jargon exclusive to Microsoft, but it's jargon you need to know. We don't encounter the term spend much in the engineering side of the company, but it's in common use among those who regularly deal with money and budgets. We are in line with company standards with regard to spend for this type of event. Q4 spend will be higher as a result of widget recolorization. Our corresponding spend will increase significantly if we adopt this proposal. From the above citations, it is apparent that the word spend is shorthand for expenditure. And then there's this citation: I'...

Sep 15, 2014
Post comments count 0
Post likes count 1

Enumerating all the ways of making change

Raymond Chen

Today's Little Program enumerates all the ways of making change for a particular amount given a set of available denominations. The algorithm is straightforward. To make change for a specific amount from a set of available denominations, you can take one denomination and decide how many of those you want to use. Then use the remaining denominations to make change for the remainder. For example, if the available coins have values [1, 5, 10, 25] and you want to make change for 60 cents, you first decide how many 25-cent pieces you want to use. If you use none, then you need to make change for 60 cents using ju...

Sep 12, 2014
Post comments count 0
Post likes count 1

What did Windows 3.1 do when you hit Ctrl+Alt+Del?

Raymond Chen

Figuring out what is messed up.

Sep 11, 2014
Post comments count 0
Post likes count 2

A lie repeated often enough becomes the truth: The continuing saga of the Windows 3.1 blue screen of death (which, by the way, was never called that)

Raymond Chen

Not quite Truthiness, but getting close.

Sep 11, 2014
Post comments count 0
Post likes count 1

The history of Win32 critical sections so far

Raymond Chen

The structure has gone through a lot of changes since its introduction back oh so many decades ago. The amazing thing is that as long as you stick to the documented API, your code is completely unaffected. Initially, the critical section object had an owner field to keep track of which thread entered the critical section, if any. It also had a lock count to keep track of how many times the owner thread entered the critical section, so that the critical section would be released when the matching number of calls was made. And there was an auto-reset event used to manage contention. We'll look more at that eve...

Sep 10, 2014
Post comments count 0
Post likes count 2

I wrote the original blue screen of death, sort of

Raymond Chen

It was blue, but it wasn't completely deadly.

Sep 9, 2014
Post comments count 0
Post likes count 2

Steve Ballmer did not write the text for the blue screen of death

Raymond Chen

Mixing up different dialog screens, all blue in color.

Sep 8, 2014
Post comments count 0
Post likes count 1

The wisdom of seventh graders: The emergency survival kit

Raymond Chen

As a precursor to reading a story about survival, seventh grade students were asked to come up with a list of things they would want to have in their emergency survival kit. Students were specifically instructed to limit themselves to things that were readily available (so no Apache helicopters), and the complete kit had to be something you could comfortably carry in a student backpack. As always, there are students who chose a very sensible collection of things to put in their emergency survival kit: water purification tablets, a flashlight (with batteries), a first-aid kit. Those students are not the subject ...