Changing the Name of a DLL (OS/2, Windows)

The name of a DLL is encoded inside the DLL. The name of a DLL is also encoded inside modules that use the DLL, because the DLL name is part of the external name of symbols that are defined in the DLL. Therefore, you cannot change the name of a DLL by simply renaming the file that contains the DLL.

You may want to change the name of a DLL for the following reasons:

You can use the dllrname utility to rename any DLL used by an application that meets the following criteria:

The class IDynamicLinkLibrary from the IBM Open Class Library
the function DosLoadModule in the OS/2 Toolkit
the function loadlibrary in the Windows SDK

The new name for the DLL must have the same number of characters as the old name. This is because dllrname overwrites external names that are recorded inside a module and cannot insert or delete characters.

The name of the DLL is itself an external name that is stored inside the DLL, and is called the internal name of the module. The loader does not load a DLL unless the internal name matches the file name. The other external names that appear in a module are the names of the DLLs to be loaded with the module. The dllrname utility changes the file name for a DLL as well as its internal name. If you specify modules that use the DLL on the command line, dllrname also changes the name of the DLL in those modules.



The VisualAge C++ Shared Runtime Library
Run-Time Environments
Repackaging VisualAge C++ DLLs for Distribution
Introduction to the Open Class Library


Build Dynamic Link Libraries
Choose Your Run-Time Library
Find Out What DLLs a Module Uses
Use the dllrname Utility


Run-Time Library File Names