The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

The path-searching algorithm is not a backtracking algorithm
Feb 8, 2012
Post comments count 0
Post likes count 0

The path-searching algorithm is not a backtracking algorithm

Raymond Chen
Raymond Chen

Suppose your PATH environment variable looks like this: Suppose that you call intending to load the library at . If the network server is down, the call will fail. Why doesn't it just skip the bad directory in the PATH and continue searching? Suppose the function skipped the bad network directory and kept searching. Suppose that the code which called was really after the file . By taking the server down, you have tricked the function into loading instead. (And maybe that was your DLL planting attack: If you can convince the system to reject all the versions on the by some means, you can then get to ...

Microspeak: fit
Feb 7, 2012
Post comments count 0
Post likes count 0

Microspeak: fit

Raymond Chen
Raymond Chen

In Microspeak, fit is a predicate noun which is never used on its own but always comes with a modifying adjective. For something to be a good fit is for something to be appropriate or suitable for a particular situation. The opposite of a good fit is not a bad fit, because that's pejorative. Rather, something that is not a good fit is referred to as a poor fit. The purpose of a previewer plug-in is to allow users to view the media without opening it. An image editing tool would not be a good fit for the previewing feature. (Alternatively, "would be a poor fit for the previewing feature.") To be a good fit with...

The story of the mysterious WINA20.386 file
Feb 6, 2012
Post comments count 0
Post likes count 0

The story of the mysterious WINA20.386 file

Raymond Chen
Raymond Chen

Global or local.

The compatibility constraints of error codes, episode 2
Feb 3, 2012
Post comments count 0
Post likes count 0

The compatibility constraints of error codes, episode 2

Raymond Chen
Raymond Chen

A customer reported an incompatibility in Windows 7: If A: is a floppy drive and they call and there is no disk in the drive, the call fails with the error . Previous versions of Windows failed with the error . Both error codes are reasonable responses to the situation. "The module couldn't be found because the drive is not ready." Programs should treat a failed as a failed library load and shouldn't be sensitive to the precise reason for the error. (They can display a more specific error to the user based on the error code, but overall program logic shouldn't depend on the error code.) Fortunately, the...

When you are looking for more information, it helps to say what you need the information for
Feb 2, 2012
Post comments count 0
Post likes count 0

When you are looking for more information, it helps to say what you need the information for

Raymond Chen
Raymond Chen

It's often the case that when a question from a customer gets filtered through a customer liaison, some context gets lost. (I'm giving the customer the benefit of the doubt here and assuming that it's the customer liaison that removed the context rather than the customer who never provided it.) Consider the following request: We would like to know more information about the method the shell uses to resolve shortcuts. This is kind of a vague question. It's like asking "I'd like to know more about the anti-lock braking system in my car." There are any number of pieces of information that could be provided abou...

Things I've written that have amused other people, Episode 9
Feb 1, 2012
Post comments count 0
Post likes count 0

Things I've written that have amused other people, Episode 9

Raymond Chen
Raymond Chen

A customer liaison reported that their customer wants to be able to access their machine without needing a password. They just want to be able to and be able to access the files right away. I guess because passwords are confusing, easy to forget, and just get in the way. Anyway, the customer discovered that they could do so on Windows XP by going to the folder they want to share, going to the Sharing tab, then clicking on the If you understand the security risks but want to share files without running the wizard link, and then on the Enable File Sharing dialog, clicking Just enable file sharing. What th...

The Freudian typo that will not die: Enchanced video quality
Jan 31, 2012
Post comments count 0
Post likes count 0

The Freudian typo that will not die: Enchanced video quality

Raymond Chen
Raymond Chen

While wasting time doing valuable background research on my computer, I received the following suggestion: For enchanced video quality, click here. It's good to know that the typo that I first encountered in 1993 is still alive and kicking. (And even though it's not important to the story, people will demand some sort of follow-up, so here it is: I submitted feedback to the vendor, who said that it was a known issue fixed in the next update.)

Why does it take Task Manager longer to appear when you start it from the Ctrl+Alt+Del dialog?
Jan 30, 2012
Post comments count 0
Post likes count 0

Why does it take Task Manager longer to appear when you start it from the Ctrl+Alt+Del dialog?

Raymond Chen
Raymond Chen

Amit was curious why it takes longer for Task Manager to appear when you start it from the Ctrl+Alt+Del dialog compared to launching it from the taskbar. Well, you can see the reason right there on the screen: You're launching it the long way around. If you launch Task Manager from the taskbar, Explorer just launches via the usual mechanism, and Task Manager launches under the same credentials on the same desktop. On the other hand, when you use the secure attention sequence, the program receives the notification, switches to the secure desktop, and displays the Ctrl+Alt+Del dialog. When you select Task M...

Does mapping the same shared memory two times in a process lead to double the address space usage?
Jan 27, 2012
Post comments count 0
Post likes count 0

Does mapping the same shared memory two times in a process lead to double the address space usage?

Raymond Chen
Raymond Chen

A customer designed a system which uses shared memory. Specifically, for each database file, they create a corresponding shared memory block of, say, 200MB. Multiple clients which connect to the same database file use the same shared memory block. Naturally, if two processes each access the same database file, each process will map the shared memory block into their respective address space. The question arose regarding what happens if one process connects to the same database file twice. Will the two calls to share the same address space, or will each one allocate a separate chunk of address space? Win32 makes...