The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Warum deine Mutter Deutsch spricht
May 11, 2012
Post comments count 0
Post likes count 0

Warum deine Mutter Deutsch spricht

Raymond Chen
Raymond Chen

This upcoming Sunday is Mother's Day in the United States. In recognition of the holiday last year, a local church displayed the following message on its message board: "God couldn't be / everywhere / so God made mothers / German speaking." This explains why your mother speaks German. POIDH The church in question has an evening German-language service, and the advertisement for that service juxtaposed against the Jewish proverb produced an unexpected result.

When you crash on a mov ebx, eax instruction, there aren't too many obvious explanations, so just try what you can
May 11, 2012
Post comments count 0
Post likes count 0

When you crash on a mov ebx, eax instruction, there aren't too many obvious explanations, so just try what you can

Raymond Chen
Raymond Chen

A computer running some tests encountered a mysterious crash: A colleague of mine quickly diagnosed the proximate cause. *Something* marked the code page PAGE_READWRITE, instead of PAGE_EXECUTE_READ. I suspect a bug in a driver. FOO is just a victim here. This diagnosis was met with astonishment. "Wow! What made you think to check the protection on the code page?" Well, let's see. We're crashing on a instruction. This does not access memory; it's a register-to-register operation. There's no way a properly functioning CPU can raise an exception on this instruction. At this point, what possibilities...

Cheap amusement: Searching for spelling errors in the registry
May 10, 2012
Post comments count 0
Post likes count 0

Cheap amusement: Searching for spelling errors in the registry

Raymond Chen
Raymond Chen

One source of cheap amusement is searching for spelling errors in the registry. For example, one program tried to register a new file extension, or at least they tried, except that they spelled wrong. And they wonder why that feature never worked. My discovery was that my registry contained the mysterious key . After some debugging, I finally found the culprit. There was a program on my computer that did the equivalent of this: One of my colleagues remarked, "With enough force, any peg will fit in any hole." I suspect that the code was not that aggressively wrong. It was probably something more subtle...

How do I hide a window without blocking on it?
May 9, 2012
Post comments count 0
Post likes count 0

How do I hide a window without blocking on it?

Raymond Chen
Raymond Chen

A customer was working on improving their application startup performance. They found that if their application was launched immediately after a fresh boot, the act of dismissing their splash screen was taking over 5% of their boot time. Their code removed the splash screen by calling . They suspect that the splash screen thread has, for some reason, stopped responding to messages, and while an investigation into that avenue was undertaken, a parallel investigation into reducing the cost of hiding the splash screen was also begun. One of the things they tried was to remove the style and call but they found tha...

Why can't I use the file sharing wizard if I exclude inheritable permissions from a folder's parent?
May 8, 2012
Post comments count 0
Post likes count 0

Why can't I use the file sharing wizard if I exclude inheritable permissions from a folder's parent?

Raymond Chen
Raymond Chen

In Windows Vista and Windows Server 2008, if you go to a the advanced security settings for a directory and uncheck "include inheritable permissions from this object's parent", then go back to the Sharing tab, you'll find that the "Share" button is disabled. Why is this? We don't see this behavior on Windows 7 or Windows Server 2008 R2. (Yes, a customer actually noticed and asked the question.) The sharing wizard in Windows Vista and Windows Server 2008 does not support folders with the security descriptor control bit because it isn't sure that it can restore the ACL afterward. And as the customer n...

Why are the Windows 7 system notification icons colorless?
May 7, 2012
Post comments count 0
Post likes count 0

Why are the Windows 7 system notification icons colorless?

Raymond Chen
Raymond Chen

Mike wondered why the system notification icons went colorless in Windows 7 and why they went back to regular tooltips instead of the custom tooltips. I don't know either, so I asked Larry Osterman, who was in charge of the Volume icon. And he didn't know either. He was merely given new icons by the design team. But that doesn't stop me from guessing. (Which is what I do most of the time here, I just don't explicitly say that I'm guessing.) My guess is that the design team looked at the new Windows 7 taskbar and noticed that all the system-provided pieces were subdued and unobtrusive, with two exc...

How does the MultiByteToWideChar function treat invalid characters?
May 4, 2012
Post comments count 0
Post likes count 0

How does the MultiByteToWideChar function treat invalid characters?

Raymond Chen
Raymond Chen

The flag controls how the function treats invalid characters. Some people claim that the following sentences in the documentation are contradictory: "Starting with Windows Vista, the function does not drop illegal code points if the application does not set the flag." "Windows XP: If this flag is not set, the function silently drops illegal code points." "The function fails if is set and an invalid character is encountered in the source string." Actually, the three sentences are talking about different cases. The first two talk about what happens if you omit the flag; the third talks about...

How does Explorer calculate the folder size information in the folder tooltip?
May 3, 2012
Post comments count 0
Post likes count 0

How does Explorer calculate the folder size information in the folder tooltip?

Raymond Chen
Raymond Chen

This information is accurate as of Windows 7; the algorithm may change for future versions of Windows. The information is being provided for the edification of computer network administrators, who are curious about random stuff like this since it can affect their network load. When you hover over a folder, Explorer shows an infotip (a special type of tooltip) which contains information about the directory, and the information that concerns network administrators is the "Size". How does Explorer calculate the size? Explorer calculates the size by performing a naïve recursive listing of the directory an...

Why is there sometimes a long delay between pressing a hotkey for a shortcut and opening the shortcut?
May 2, 2012
Post comments count 0
Post likes count 0

Why is there sometimes a long delay between pressing a hotkey for a shortcut and opening the shortcut?

Raymond Chen
Raymond Chen

Via a customer liaison, we received a problem report from a customer. The customer is facing issues with delayed desponses to opening a .lnk file by pressing its keyboard shortcut hotkey. This delay does not appear when the shortcut is double-clicked. For example, the customer has created a shortcut to Notepad and assigned it the shortcut Ctrl+Alt+X. Pressing the keyboard combination sometimes takes 5 or 6 seconds for Notepad to open. As noted above, double-clicking on the shortcut causes Notepad to open without delay. This issue is not consistently reproducible, but it appears to be independent of the short...