Showing results for May 2012 - Page 2 of 3 - The Old New Thing

May 17, 2012
Post comments count0
Post likes count0

Charles Petzold is back with another edition of Programming Windows

Raymond Chen
Raymond Chen

Back in the day (and perhaps still true today), Charles Petzold's Programming Windows was the definitive source for learning to program Windows. The book is so old that even I used it to learn Windows programming, back when everything was 16-bit and uphill both ways. The most recent edition is Programming Windows, 5th Edition, which was published ...

Other
May 17, 2012
Post comments count0
Post likes count0

How to view the stack of threads that were terminated as part of process teardown from the kernel debugger

Raymond Chen
Raymond Chen

As we saw some time ago, process shutdown is a multi-phase affair. After you call , all the threads are forcibly terminated. After that's done, each DLL is sent a notification. You may be debugging a problem with handling that suggests that some of those threads were not cleaned up properly. For example, you might assert that a reference count ...

Other
May 16, 2012
Post comments count0
Post likes count0

Sure, we do that: Context menu edition

Raymond Chen
Raymond Chen

A customer reported a problem that occurred only when they installed a particular application. If they uninstalled it, then the problem went away. After installing the application, the "Run As" context menu option stopped working. The customer didn't provide any other details, but we were able to make an educated guess as to what was going on. A ...

Tips/Support
May 15, 2012
Post comments count0
Post likes count0

Microspeak: The parking lot

Raymond Chen
Raymond Chen

Mike Dunn wonders what the Microspeak term parking lot means. I'm not familiar with this term either, and the first document I turned up during my search was a PowerPoint presentation that said "Avoid using Microsoft jargon terms, such as parking lot and dogfood." Yeah, that wasn't much help. From what I can gather, the term parking lot starte...

OtherMicrospeak
May 14, 2012
Post comments count0
Post likes count0

What is the historical reason for MulDiv(1, -0x80000000, -0x80000000) returning 2?

Raymond Chen
Raymond Chen

Commenter rs asks, "Why does Windows (historically) return 2 for while Wine returns zero?" The function multiplies the first two parameters and divides by the third. Therefore, the mathematically correct answer for MulDiv(1, -0x80000000, -0x80000000) is 1, because a × b ÷ b = a for all nonzero b. So both...

History
May 11, 2012
Post comments count0
Post likes count0

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-lan...

Non-Computer
May 11, 2012
Post comments count0
Post likes count0

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 pr...

Code
May 10, 2012
Post comments count0
Post likes count0

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...

Other
May 9, 2012
Post comments count0
Post likes count0

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 reaso...

Code
May 8, 2012
Post comments count0
Post likes count0

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. ...

Tips/Support