Click to Rate and Give Feedback
Tips
The easiest way to create a copy of a table is to use Transact-SQL. Find out how. ...

Read more!

Once you’ve thoroughly researched and planned your implementation of Failover clusters, you’re ready to actually create the cluster. The mechanism to create and manage Failover clusters is the Cluster Administrator application, part of the Administrative Tools folder. Here are the 12 easy steps! ...

Read more!

If you need more information on how to copy, move, delete or recover public folders, this tip's for you. ...

Read more!

Exchange Server 2007 enables Outlook Web Access for each user by default. In five steps, however, you can easily disable Outlook Web Access for specific users ...

Read more!

By default, SQL Server 2008 allocates a minimum of 1024 KB of memory for query execution. This memory allocation, however, can be set for anywhere from 512 KB to 2 GB. Find out when you should change this setting and how to do so. ...

Read more!

Related Articles

Hardware detection in the days before proper Plug and Play devices was a very scary undertaking. Find out why.

Raymond Chen

TechNet Magazine January 2008

...

Read more!

Raymond Chen explores how forcing file handles closed can lead to a series of cascading errors.

Raymond Chen

TechNet Magazine April 2009

...

Read more!

Wes Miller updates his 2007 article on the Microsoft Desktop Optimization Pack, a collection of valuable components that can can save your IT department a lot of time and effort. All of the components have been enhanced—and something new has been added.

Wes Miller

TechNet Magazine May 2009

...

Read more!

A look at how the DirectInput force feedback joystick interface specifies periodic forces—and some of the unexpected results.

Raymond Chen

TechNet Magazine December 2007

...

Read more!

Raymond Chen fondly reminisces about working with the two worst computers ever made.

Raymond Chen

TechNet Magazine June 2008

...

Read more!

Also by this Author

Have you ever noticed that the cursor blinks when you take a screen capture? Raymond Chen explains why.

Raymond Chen

TechNet Magazine February 2009

...

Read more!

Here's some history about how a couple of not so incredibly popular features disappeared.

Raymond Chen

TechNet Magazine February 2008

...

Read more!

Raymond Chen explores how forcing file handles closed can lead to a series of cascading errors.

Raymond Chen

TechNet Magazine April 2009

...

Read more!

Raymond Chen explains why Windows can but chooses not to replace a file that is currently in use.

Raymond Chen

TechNet Magazine November 2008

...

Read more!

A look at how the DirectInput force feedback joystick interface specifies periodic forces—and some of the unexpected results.

Raymond Chen

TechNet Magazine December 2007

...

Read more!

Popular Articles

Discover how to use the Excel.Application automation model for a more powerful way to process data from your servers and take advantage of the analysis and charting tools built into Excel.

The Microsoft Scripting Guys

TechNet Magazine January 2009

...

Read more!

Raymond Chen looks at the skewed relationship bugs have to errors, and explains why it's important that programmers suffer as well as give results.

Raymond Chen

TechNet Magazine October 2008

...

Read more!

Take a close look at SharePoint Security Accounts to see how a weak configuration can give an attacker full control over all site collections and sites.

Pav Cherny

TechNet Magazine January 2009

...

Read more!

Windows Vista SP1 and Windows Server 2008 introduce important changes to BitLocker, including support for data volumes and improved protection against cryptographic attacks. Byron Hynes explores the new features, demonstrates how to use BitLocker on a server, and discusses some of the recent media coverage affecting BitLocker.

Byron Hynes

TechNet Magazine June 2008

...

Read more!

The upcoming release of Microsoft Identity Lifecycle Manager “2” offers many new features and enhancements. Explore the new portal experience and find out how you can cut costs with self-service tools, increase security compliance with business process modeling, and reduce development time with simplified development tools.

Aung Oo

TechNet Magazine January 2009

...

Read more!

Our Blog

NAP monitors the health of specified computers when they attempt to connect to a network and includes a number of mechanisms to enforce health requirements. In this article, Geek of All Trades Greg Shields gives readers an overview of these enforcement mechanisms and, as an example, takes a closer look at setting ...

Read more!

Use Windows PowerShell to Manage Virtual Machines Here are a few examples of how you can use Windows PowerShell scripts to manage virtual machines running on a Server Core installation. Note that these scripts are presented as samples and may need to be customized to work in your environment.

Create a New ...

Read more!

Disabling an Unused Part of Group Policy Objects One way to disable a policy is to disable an unused part of the GPO. By disabling part of a policy that isn’t used, the application of GPOs and security will be faster.

Administer Windows Server 2008 Server Core from the Command Prompt ...

Read more!

In the August 2008 issue of TechNet Magazine, Paul Randal wrote an article Top Tips for Effective Database Maintenance.  It was geared toward "involuntary  DBAs" (IT pros who inadvertently wind up responsible for a SQL Server instance).  The article had a great response from our readers so Paul has written another ...

Read more!

Microsoft Forefront is designed to deliver an integrated security solution that makes it much easier to deploy and manage security across an organization’s IT infrastructure. In this, our annual security issue, we feature two articles that describe how Forefront Security protects instant messaging and e-mail.

Protect ...

Read more!

Windows Confidential Getting Out of DLL Hell
Raymond Chen


DLL HELL. A problem so insidious it has its own pejorative nickname. You install one program and suddenly some seemingly unrelated program stops working. This is because, unknown to you, the two programs are connected via a shared DLL file. The two programs might have different ideas of what version of the MSVCRT.DLL file should be in the system directory. Or the first program may upgrade an ActiveX® control that the second program uses-an upgrade that the second program is not entirely compatible with.
If both programs are essential to your company's day-to-day operations, it doesn't really matter which program is to blame. The important thing is that you need to get them up and running. There isn't much difference between "We're losing money" and "We're losing money because of Bob." Either way, your company is losing money and it's your job to fix the problem right away.
It used to be that you had to choose which program won and which program lost. Starting with Windows® 2000, bandages were made available to help you patch over these conflicts. These bandages, however, are only temporary solutions, allowing you to get your system back on its feet while you investigate a more permanent resolution to the conflict.
Windows 2000 implemented a rudimentary version of what now goes by the fancy name of Dynamic-Link Library Redirection. To enable DLL redirection, create a file with the same name as the program whose DLLs you wish to redirect, but with .local appended to the name. For example, to apply redirection to C:\Program Files\Litware Inc\Invoice.exe, create the file C:\Program Files\Litware Inc\Invoice .exe.local. The contents of the file aren't important; what's important is that the file exists.
Once you've enabled redirection for a program, all attempts by that program to load a DLL will first look in the directory that contains the program before the usual search locations. Therefore, in the case of the conflicting MSVCRT.DLL file, you can enable redirection in each program and put a private copy of MSVCRT.DLL into each program's installation directory. Each program then receives its own version of MSVCRT.DLL-the version of the DLL with which the program was tested.
The magic of this technique is that it works even if the program uses a full path to load the DLL. For example, suppose the program tries to load C:\Program Files\Common Files\Proseware Inc\taxplugin.dll. After upgrading to Proseware 2.0, you discover that its tax plug-in is incompatible with your invoice program. What you can do is copy an old version of the tax plug-in to C:\Program Files\Litware Inc\taxplugin.dll. Even though the program uses a full path to load the tax plug-in, DLL redirection will still look in the current directory and use the local override instead of the one in the Proseware Inc directory.
In Windows XP and Windows Vista™, the rules for DLL redirection are a little different, but the general principle remains the same. In addition to creating a .local file, you can also create a .local directory. In that case, the .local directory is searched rather than the program's install directory. This allows you to apply redirection to multiple programs in the same directory without conflict.
Note that you cannot apply redirection to programs that contain an application manifest, and so-called known DLLs are also exempt from redirection. (For further details, see "Dynamic-Link Library Redirection".)
DLL redirection won't entirely get you out of DLL Hell, but at least it gives you some first-aid techniques for tending the wound while you sort out the problem.
Figure 1   

Raymond Chen writes about both Windows history and Win32 programming on his Web site, The Old New Thing, as well as in his new book also titled The Old New Thing (Addison-Wesley, 2007). He does not, however, have a pet cat named The Old New Thing.
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker