The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

You don't make something easier to find by hiding it even more deeply
Aug 22, 2011
Post comments count 0
Post likes count 0

You don't make something easier to find by hiding it even more deeply

Raymond Chen
Raymond Chen

Commenter rolfhub suggested that, to help people recover from accidentally going into Tiny Footprint Mode, the Task Manager could display a right-click context menu with an entry to return to normal mode. My initial reaction to this was Huh? Who right-clicks on nothing? Tiny Footprint Mode is itself already a bad secret hidden setting. Having the exit from the mode be a right-click menu on a blank space is a double-secret hidden setting. If I had dictatorial control over all aspects of the shell, I would put a Restore button  in the upper right corner to let people return to normal mode.

Why are the alignment requirements for SLIST_ENTRY so different on 64-bit Windows?
Aug 19, 2011
Post comments count 0
Post likes count 0

Why are the alignment requirements for SLIST_ENTRY so different on 64-bit Windows?

Raymond Chen
Raymond Chen

The function stipulates that all list items must be aligned on a boundary. For 32-bit Windows, is 8, but the structure itself does not have a attribute. Even more confusingly, the documentation for says that the 64-bit structure needs to be 16-byte aligned but says nothing about the 32-bit structure. So what are the memory alignment requirements for a 32-bit , 8 or 4? It's 8. No, 4. No wait, it's both. Officially, the alignment requirement is 8. Earlier versions of the header file did not stipulate 8-byte alignment, and changing the declaration would have resulted in existing structures which ...

Ow, I'm too safe!
Aug 18, 2011
Post comments count 0
Post likes count 0

Ow, I'm too safe!

Raymond Chen
Raymond Chen

One of my friends is a geek, and, naturally, fully researches everything he does, from cement pouring to bicycle parts, perhaps a bit obsessively. He made sure to get five-point restraints for his children's car seats, for example. And he naturally tightens the belts snugly when putting his children in the car. At one point, as he was strapping his daughter in, she complained, "Ow! I'm too safe!" Because as far as she was concerned, "being safe" was a synonym for "having a tight seat belt." I leave you to figure out how she came to this conclusion.

Why does IFileOperation skip junctions even though I passed FOFX_NOSKIPJUNCTIONS?
Aug 18, 2011
Post comments count 0
Post likes count 0

Why does IFileOperation skip junctions even though I passed FOFX_NOSKIPJUNCTIONS?

Raymond Chen
Raymond Chen

The method accepts a number of flags to modify the file operation, among them today's subject . A customer reported that they couldn't get this flag to work: Whether they set it or not, the skipped over file system junctions. The term junction evolved two independent different meanings. The shell team invented the term shell namespace junction in Windows 95 to refer to a point in the shell namespace in which one type of namespace extension is grafted into another. For example, a directory of the form serves as the transition point between the default file system namespace and a custom namespace. Meanw...

Starting up inside the box
Aug 17, 2011
Post comments count 0
Post likes count 0

Starting up inside the box

Raymond Chen
Raymond Chen

the shell team received two customer questions about a month apart which seemed unrelated but had the same root cause. I found that in Windows Vista, the command is ten times slower than it was in Windows XP. What is the source of this slowdown, and how can I fix it? We have an application which takes a very long time to start up on Windows Vista than it did in Windows XP. We noticed that the slowdown occurs only if we set the application to autostart. Let's look at the second one first, since that customer provided a useful piece of information: The slowdown occurs only if they set the progr...

Why does creating a shortcut to a file change its last-modified time… sometimes?
Aug 16, 2011
Post comments count 0
Post likes count 0

Why does creating a shortcut to a file change its last-modified time… sometimes?

Raymond Chen
Raymond Chen

A customer observed that sometimes, the last-modified timestamp on a file would change even though nobody modified the file, or at least consciously took any steps to modify the file. In particular, they found that simply double-clicking the file in Explorer was enough to trigger the file modification. It took a while to puzzle out, but here's what's going on: When you double-click a file in Explorer, Explorer adds it to the Recent Items list. Internally, this is done by creating a shortcut to the item. The nice thing about a shortcut is that it knows how to track its target. That way, if you move an item, the...

Why does the runas command require its command line to be quoted?
Aug 15, 2011
Post comments count 0
Post likes count 1

Why does the runas command require its command line to be quoted?

Raymond Chen
Raymond Chen

Commenter teo complained that the command requires its command line to be quoted. Well, if you think about it, why single out ? Pretty much all programs require their command line to be quoted if they contain special characters (like spaces that you want to be interpreted as part of a file name instead of as an argument separator). The command is just doing things the way everybody else does. Recall that on Windows, programs perform their own command line parsing. This isn't unix where the command shell does the work of parsing quotation marks and globs before handing the (now-partly-parsed) command line to ...

ReadDirectoryChangesW reads directory changes, but what if the directory doesn’t change?
Aug 12, 2011
Post comments count 0
Post likes count 1

ReadDirectoryChangesW reads directory changes, but what if the directory doesn’t change?

Raymond Chen
Raymond Chen

Not all changes within a directory result in the directory changing.

The ways people mess up IUnknown::QueryInterface, episode 4
Aug 11, 2011
Post comments count 0
Post likes count 0

The ways people mess up IUnknown::QueryInterface, episode 4

Raymond Chen
Raymond Chen

One of the rules for is so obvious that nobody even bothers to state it explicitly as a rule: "If somebody asks you for an interface, and you return , then the pointer you return must point to the interface the caller requested." (This feels like the software version of dumb warning labels.) During compatibility testing for Windows Vista, we found a shell extension that behaved rather strangely. Eventually, the problem was traced to a broken implementation which depended subtly on the order in which interfaces were queried. The shell asked for the and interfaces in the following order: One parti...