Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles
Make a new tip by beating yourself in the head with a keyboard ...

Read more!

Active Directory, why it rocks! ...

Read more!

This is teh descriptionBla ...

Read more!

Waka wakka wakka! ...

Read more!

This Tip will explain how to send email from Exchange ...

Read more!

Also by this Author

Raymond Chen explains how a bit of diagnostic code unexpectedly brought the Windows 95 build to crawl.

Raymond Chen

TechNet Magazine September 2008

...

Read more!

How does Windows determine the list of frequently used programs that appears on the Start menu? The concept started with a simple premise that soon required a lot of fine tuning. Here’s an inside look at the logic behind the design of this feature.

Raymond Chen

TechNet Magazine May 2007

...

Read more!

Raymond Chen discusses the intriguing backstory of how naming conventions for non-final releases have changed. And he gives a gentle plea for companies to take beta testing more seriously.

Raymond Chen

TechNet Magazine March 2008

...

Read more!

"Are you sure you want to remove this shared file?" Raymond Chen explains why an uninstaller may ask this question when you remove a program.

Raymond Chen

TechNet Magazine April 2008

...

Read more!

Imagine buying a new computer, firing up Windows, clicking the Start button, and seeing a blank menu. There's a reason why the Start menu includes applications in the most frequently used spot before you've used anything--to provide a good out-of-box experience. Find out how these apps are chosen.

Raymond Chen

TechNet Magazine June 2007

...

Read more!

Popular Articles

The introduction of Hyper-V makes virtualization an even more compelling solution for IT environments. Get an overview of today’s virtualization market and see how Hyper-V improves the manageability, reliability, and security of virtualization

Rajiv Arunkundram

TechNet Magazine October 2008

...

Read more!

How do you secure the desktop against malicious ActiveX controls without limiting application compatibility? We’ll take you on a tour of the ActiveX Installer Service (AxIS) in Windows Vista that addresses this issue with a new way to manage ActiveX controls.

Rob Campbell and Joel Yoker

TechNet Magazine July 2007

...

Read more!

Many organizations rely on ISA Server 2006 to secure their environment, but few take the important step of securing ISA Server itself. Here’s a guide to using the Security Configuration Wizard and Administrative roles to limit its attack surface and secure your ISA Server 2006 implementation.

Alan Maddison

TechNet Magazine September 2008

...

Read more!

There are numerous advantages to running your organization’s applications centrally, and getting started is now surprisingly easy. Here’s what you need to know in order to enable Terminal Services on Windows Server 2003 and implement Terminal Services throughout your organization.

James D. Silliman

TechNet Magazine May 2007

...

Read more!

Backup is something many people ignore until it’s too late. But there’s no excuse for this, especially now that the new Windows Vista Backup and Restore Center offers a variety of features that make it easy to protect your data against most forms of data loss. Find out how you can plan a complete recovery strategy with Windows Vista.

Christine Fok

TechNet Magazine September 2007

...

Read more!

Our Blog
In the November 2008 installment of our Windows PowerShell column (which is available online), Don Jones demonstrates how to create a tool that will inventory the operating system build number (this is one of the best ways to determine the OS version) and service pack version number from a list of computers.  ...

Read more!

Did you just go “whoa!” when you saw that title? Bet you never thought you’d see that here! But the times, as they say, are a-changing and we have too. Many organizations today use multiple operating systems. We all have the same goal of providing high-quality, cost-effective IT services to the organization, and one way we can do that is by sharing core software infrastructure like Active Directory. ...

Read more!

Proxy authentication lets users perform a simple bind to an Active Directory Lightweight Directory Services instance but still have an association to an Active Directory account. This can be very useful: it gives developers full access to a user object without giving them access to the Active Directory account, and it allows products that require the X.500 format to be used with Active Directory. ...

Read more!

In every issue of TechNet Magazine, Greg Steen (a practicing IT professional) discusses free and relatively inexpensive tools and utilities that help him do his IT work and "getting the job done." 

In the November issue, Greg looks at mapping data graphically with MapForce, creating and managing ...

Read more!

In this month’s TechNet Magazine, you’ll find the second of a series of Field Notes columns written by Romi Mahajan, Chief Marketing Officer of Ascentium Corporation. As an early innovator in the field of electronic ...

Read more!

Windows Confidential Compatibility Constraints
Raymond Chen


WHEN YOU THINK of a new version of Windows® maintaining backwards compatibility with applications designed for previous versions of Windows, you tend to think of the explicit programming contract: things like the behavior of window messages, the semantics of the heap, and that GetTextMetrics will get the text metrics. But that's the easy part of maintaining compatibility, since those rules are actually written down. The hard part is maintaining compatibility with the things that merely happen. Some behaviors are not contractual, and often they aren't even designed—they just happen by circumstance.
The Windows Shell team recently came across an application that wanted to map a network drive when the user clicked the corresponding toolbar button. But to do this, the application's developers didn't call the WNetConnectionDialog1 function. Instead, they decided to create a context menu on the My Computer object and then invoke the Map Network Drive command from the menu, which in turn calls the WNetConnectionDialog1 function. In other words, the application's developers avoided the documented function and relied on a middle man to do this work for them. This middle man, I should point out, is under no contractual obligation to have a Map Network Drive command in the future.
But it gets better. The developers didn't write the program to invoke the Map Network Drive command. Rather, they observed that the command was always the third item on the menu and, therefore, simply had the application invoke item three.
But what about context menu extensions, such as Add to Playlist? Since all of these extensions are typically added near the top of the menu, the developers adjusted their algorithm: instead of executing the third item on the menu, they executed the fifth-from-the-bottom menu item.
But wait, it gets better still. They also noticed that the Map Network Drive menu option had a different position on Windows 2000 than on Windows XP. So before invoking the command, the application checks which operating system it is running on and adjusts the computations accordingly.
For Windows Vista™, we did some work to clean up the context menus, removing commands that are redundant and moving rarely used commands to the extended menu. (In case you're wondering, you reach the extended menu by holding the shift key when right-clicking the item.) After we cleaned up the menus, this program (not surprisingly) ended up executing some other command instead of the one it wanted, thanks to the reordering of menu items.
Some people may argue that Microsoft should leave the program broken as a form of punishment. But then who would really be getting punished? The customers who were using this program would be stuck until the vendor produces an upgrade that fixes the problem. They would lose the use of the program for a few months ("sorry, but you missed the contract bid deadline while you were out of commission") and then they may even have to shell out some cash for an upgrade that fixes the problem. The customer suffers lost productivity; the vendor gets upgrade revenue.
Looks like the vendor wins and the customer loses. (Not to mention that many users would probably blame the new version of Windows for breaking a program that ran perfectly fine in the first place.)
What's more, this program is a competitor to a Microsoft product. The conspiracy theorists would once again be apoplectic with glee, posting articles to blogs about how "Windows Vista intentionally cripples competing software in order to give Microsoft an unfair advantage." In the world of Windows, it sometimes feels like everything is a compatibility constraint

Raymond Chen's Web site, blogs.msdn.com/oldnewthing, deals with Windows history and Win32 programming. He also loves what you've done with your hair.
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker