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

Beyoncé, the giant metal chicken has a Facebook page

In my 2011 mid-year link clearance, I linked to the story And that's why you should learn to pick your battles. I thought that was the end of the story, but no, it's the gift that keeps on giving. Beyoncé, the giant metal chicken has a Facebook page, populated with all sorts of crazy things like pictures of Beyoncé's relatives spotted in the wild (some of them knocking on doors or peeking in windows), a No Soliciting sign just for giant metal chickens, and an updated version of the chart of anniversary gifts which lists BIG METAL CHICKEN as the modern 15th anniversary present.

Adjusting your commute to avoid being at work quite so much

Commenter Bernard remarked that he moved from one side of the company campus to the other, and his commute distance (and time) was cut in half. That reminds me of a short story from a now-retired colleague of mine. He bicycled to work, and over the years, the gradual expansion of the Microsoft main corporate campus resulted in nearly three quarters of his commute to work taking place on Microsoft property. This bothered him to the point where he changed his route just so he wouldn't be "at work" practically the moment he left his house. Bonus chatter: Looks like Michael Kaplan also has one of these unbalanced...

Do not access the disk in your IContextMenu handler, no really, don't do it

We saw some time ago that the number one cause of crashes in Explorer is malware. It so happens that the number one cause of hangs in Explorer is disk access from context menu handlers (a special case of the more general principle, you can't open the file until the user tells you to open it). That's why I was amused by Memet's claim that "would hit the disk" is not acceptable for me. The feedback I see from customers, either directly from large multinational corporations with 500ms ping times or indirectly from individual users who collectively click Send Report millions of times a day, is that "would h...

2011 Q3 link clearance: Microsoft blogger edition

It's that time again: Linking to other Microsoft bloggers.

There's also a large object heap for unmanaged code, but it's inside the regular heap

Occasionally, a customer will ask for assistance explaining some strange heap behavior, or at least heap behavior that appears to be strange if you assume that the heap behaves purely classically. I need to understand the heap behavior we're seeing. I have a sample program which allocates five blocks of memory from the process heap, each of size 100 bytes. When we dump the heap blocks with the command, we find that all of them belong to the same heap segment, and when we do a , we find that they all live on the same page. On the other hand, if we allocate five blocks of size 512KB, then we find that each one...

Appearing to succeed is a valid form of undefined behavior, but it's still undefined

A customer requested a clarification on the MSDN documentation for the function. The MSDN documentation says that if the parameter is , then the behavior is undefined. Is this true? As explicitly stated in MSDN, the behavior is undefined. Observe that the annotation on the parameter is , which means that the parameter must be a non- value provided by the caller. (If were permitted, the annotation would have been .) Undefined behavior means that anything can happen. The program might crash immediately. It might crash five minutes later. It might send email to your boss saying that you screwed up and t...

Does this operation work when impersonating? The default answer is NO

Impersonation requires end-to-end support.

Ah, the exciting world of cross-forest dogfood

The Windows group has its own domain (known as for historical reasons) which operates separately from the domain forest operated by the Microsoft IT department. Various trust relationships need to be set up between them so that people on the Windows team can connect to resources managed by the Microsoft IT department and vice versa, but it generally works out okay. There are some glitches, but that's the price of dogfood. What better way to make sure that Windows works well in a cross-forest environment than by putting the entire Windows division in its own domain separate from the rest of the company? ...

Sending a window a WM_DESTROY message is like prank calling somebody pretending to be the police

A customer was trying to track down a memory leak in their program. Their leak tracking tool produced the stacks which allocated memory that was never freed, and they all seemed to come from , which is a DLL that comes with Windows. The customer naturally contacted Microsoft to report what appeared to be a memory leak in Windows. I was one of the people who investigated this case, and the customer was able to narrow down the scenario which was triggering the leak. Eventually, I tracked it down. First, here's the thread that caused the leak: This thread creates an invisible window whose job is to do somethin...