The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

How can I tell whether a DLL has been registered?

A customer pointed out that you can use to register a DLL or to unregister it, but how do you query whether a DLL has been registered? DLL registration (via ) is not declarative; it is procedural. A DLL does not provide a manifest of things it would like to happen when installed. Instead, the DLL merely provides two functions for to call, one for registration () and another for unregistration (). All the function does is call those functions. How those functions perform their registration and unregistration is not specified. Most of the time, those functions merely write some registry settings, but the is n...

Okay, everybody, it's time for rumors and gossip

A friend of mine told me one technique his boss used for keeping group meetings on time. The last item on every meeting agenda was called Rumors and gossip. A group meeting is sort of like a mandatory watercooler session. Everybody is now in a room sitting around a table, and you naturally start discussing whatever rumors you've heard about what's going on in upper management, that newspaper article about what your competition is up to, or whether you think your supplier is really going to deliver that component on time. Whenever the meeting started to drift into rumors and gossip, the boss would simply say, "S...

Microspeak: Level-set

In mathematics, a level set is the set of points at which a function takes a particular value. This has nothing to do with the way the term is used at Microsoft. In fact, the way the term is used at Microsoft, I have no idea what it means. But here are citations. The first is from an upper-level executive: Before we start the meeting, let me level-set. Here's what we plan to accomplish today. The next is from a presentation to a large group on some investigative work a team undertook. After the presenter spent a few minutes discussing the background of the problem: That's some level-setting on the hardware w...

Percentages may not add up to 100%, but not for the reason you suggest

I saw a chart which had the disclaimer, "Percentages may not add up to 100%, as they are rounded to the nearest percent." The values in the table were 10.4%, 4.0%, 9.4%, 9.3%, 9.2%, 21.2%, 20.0%, and 15.8%. This is a use of the phrase "nearest percent" I was previously unfamiliar with.

The life story of the SwitchToThisWindow function

Originally for the MS-DOS emulation layer.

How do I generate a unique 32-bit value for a time zone?

Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. A customer asked the following question: Given two structures, I would like to compute a for each that I can then compare to determine whether they represent the same time zone. When I say the same, I mean that when the two are passed to with the same input, the output is the same. A structure contains more information than can be packed into a 32-bit value. (At least there's no obvious way to pack it into a 32-bit valu...

We've traced the call and it's coming from inside the house: A function call that always fails

A customer reported that they had a problem with a particular function added in Windows 7. The tricky bit was that the function was used only on very high-end hardware, not the sort of thing your average developer has lying around. The customer reported that the function always failed with error 122 () even though the buffer seems perfectly valid. Since most of us don't have machines with more than 64 processors, we couldn't run the code on our own machines to see what happens. People asked some clarifying questions, like whether this code is compiled 32-bit or 64-bit (thinking that maybe there is an ...

Debugging why a user's taskbar disappeared

A customer reported that they had gone to the Screen Saver control panel, selected a screen saver that they had recently downloaded, then hit the Test button to see what it looked like. He was pleased with what he saw, and he went home, leaving the screen saver running. When he returned the following morning, he found that the screen saver had crashed. (There was an error message on the screen.) After dismissing the crash dialog, he found that his taskbar was missing. What happened? We were unable to determine for sure, but debugging the customer's machine revealed that the taskbar no longer had the style, mos...

The power of statistical photography

Inside Microsoft, there was an employee photography contest to provide images to be included in Windows 7, either in one of the pre-release versions or in the final product. Each subsidiary selected the photos to be included in their localized version of Windows, choosing images which best reflect that region's culture, history, and natural beauty. The employee-submitted photos were in direct competition against the professional photographs; as a result, some regions ended up selecting multiple employee-contributed images and others picked none. The Swiss delegation, in characteristically Swiss fashion, ...