The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

If NTFS is a robust journaling file system, why do you have to be careful when using it with a USB thumb drive?
Jan 1, 2013
Post comments count 0
Post likes count 0

If NTFS is a robust journaling file system, why do you have to be careful when using it with a USB thumb drive?

Raymond Chen
Raymond Chen

It's a case of filesystem-colored glasses.

2012 year-end link clearance
Dec 31, 2012
Post comments count 0
Post likes count 0

2012 year-end link clearance

Raymond Chen
Raymond Chen

It goes again.

Why can't you rename deleted items in the Recycle Bin?
Dec 31, 2012
Post comments count 0
Post likes count 0

Why can't you rename deleted items in the Recycle Bin?

Raymond Chen
Raymond Chen

I misread a question from commenter Comedy Gaz, so let's try it again. (Good thing I held one last Suggestion Box Monday of the year in reserve.) Why can't you rename deleted items in the Recycle Bin? Okay, first of all, "Why would you want to do this?" I see no explanation for how this could possibly escape the 100-point hole every feature starts out in. I mean, these are items you deleted. Why do you care what their names are? Are you renaming it so you can find it again later? Why would you go to the effort of locating an item in the Recycle Bin, and then not bother recovering it? It's like calling the ...

What do HeapLock and HeapUnlock do, and when do I need to call them?
Dec 28, 2012
Post comments count 0
Post likes count 0

What do HeapLock and HeapUnlock do, and when do I need to call them?

Raymond Chen
Raymond Chen

You never need to call the and functions under normal operation. Assuming the heap is serialized (which is the default), all the standard heap functions like and will automatically serialize. In fact, the way they serialize is by calling the¹ and functions! Nearly all heap operations complete in a single call. If your heap is serialized, this means that the heap operation takes the heap lock, does its work, and then releases the heap lock and returns. If all heap operations were like this, then there would be no need for or . Unfortunately, there is also the function, which does a little bit o...

What is so special about the instance handle 0x10000000?
Dec 27, 2012
Post comments count 0
Post likes count 0

What is so special about the instance handle 0x10000000?

Raymond Chen
Raymond Chen

A customer wanted to know what it means when the function returns the special value . Um, it means that the library was loaded at ? Okay, here's some more information: "We're trying to debug an application which loads DLLs and attempts to hook their registry accesses when they call . It looks like when the special handle is returned from , the registry writes go through and bypass the hook. On the other hand, when a normal value is returned by , the hook works." There is nothing special about the value . It's an address like any other address. At this point, your psychic powers might start tingling. Everybod...

What celebration of Kwanzaa would be complete without Sandra Lee's infamous Kwanzaa cake?
Dec 26, 2012
Post comments count 0
Post likes count 0

What celebration of Kwanzaa would be complete without Sandra Lee's infamous Kwanzaa cake?

Raymond Chen
Raymond Chen

For those unfamiliar with Sandra Lee, her gimmick is that the ingredients in her recipes are primarily prepared foods, a food-preparation technique (I'm reluctant to call it cooking) which she calls "semi-homemade." First, the creation one critic called "an edible hate crime." Next, the apology from the creator. I guess I imagined something more refined. And I know the Corn Nuts were disgusting, but she didn't. As a matter of fact, the more tasteless the recipes got the more she liked them, the faster she approved them.

A question about endian-ness turns out to be the wrong question
Dec 26, 2012
Post comments count 0
Post likes count 0

A question about endian-ness turns out to be the wrong question

Raymond Chen
Raymond Chen

Via a customer liaison, we received what seemed like a simple question: "How can I detect whether a Windows machine is big-endian or little-endian?" You could actually answer this question (say by coughing up a code fragment that stores a 16-bit value to memory and then takes it apart into bytes to see how it got stored, or by simply hard-coding it based on the target architecture you are compiling for), but you'd be making the mistake of answering the question instead of solving the problem. The customer liaison explained, "My customer is having a problem that is caused by a bug in the SAP BI connector. Accor...

You too can use your psychic powers: Spaces in paths
Dec 25, 2012
Post comments count 0
Post likes count 0

You too can use your psychic powers: Spaces in paths

Raymond Chen
Raymond Chen

I'm going to be lazy today and make you solve the problem. Did a recent security hotfix change change the way we handle UNC paths with spaces? Normally, if we open the Run dialog and type , the folder opens. But recently it stopped working. Instead of opening the folder, we get the Open With dialog: Choose the program you want to use to open this file: File: Support Browse... OK   Cancel Can you figure out what happened recently that introduced this problem? You have all the information you need...

Miss Denmark, she is dressed as a mermaid because we couldn't secure the rights from LEGO
Dec 24, 2012
Post comments count 0
Post likes count 0

Miss Denmark, she is dressed as a mermaid because we couldn't secure the rights from LEGO

Raymond Chen
Raymond Chen

Once again, the commentary is NSFW, but once again, they so deserve it. Miss Universe 2012 National Costumes, Part 1 my favorite is the commentary for the Dominican Republic) Miss Universe 2012 National Costumes, Part 2 Miss Universe 2012 National Costumes, Part 3 (but Venezuela wins the things on top her head category) By the way, here's your dress made of LEGO. And for completeness, because I forgot to link to it last year: Miss Universe 2011 National Costumes, Part 1 Miss Universe 2011 National Costumes, Part 2