Browse Prior Art Database

Dynamic Link Library Merge Utility

IP.com Disclosure Number: IPCOM000112138D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 6 page(s) / 228K

Publishing Venue

IBM

Related People

Dobbelstein, SL: AUTHOR [+2]

Abstract

A programmer may need to add some enhanced function onto currently existing functions in an OS/2 Dynamic Link Library (DLL). Normally this would require that the programmer get access to the source code for the DLL, add the new enhanced function, and then rebuild the DLL. The programmer may not have access to the DLL's source code. Disclosed is a way to add new function onto an existing DLL without having to modify the DLL's source code.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 23% of the total text.

Dynamic Link Library Merge Utility

      A programmer may need to add some enhanced function onto
currently existing functions in an OS/2 Dynamic Link Library (DLL).
Normally this would require that the programmer get access to the
source code for the DLL, add the new enhanced function, and then
rebuild the DLL.  The programmer may not have access to the DLL's
source code.  Disclosed is a way to add new function onto an existing
DLL without having to modify the DLL's source code.

      The solution is to create a program that will merge the
necessary functional enhancements into an existing DLL.  DLLs are
packaged in an EXE format with an EXE header at the front of the
file.  The program does the merge by modifying the EXE header in the
DLL.  The DLL merge utility makes use of several key components in
the EXE header:

The Segment Table

The Imported Names Table -- lists functions imported from other
modules

The Resident Names Table -- lists functions exported to other modules

      The utility also uses other tables in the EXE header that
support these tables and modifies other fields in the EXE header to
complete the merge.  The details are discussed in "Details of the DLL
Merge Utility."

      All of the code to support the enhanced functions is built into
a separate DLL.  For the sake of clarity, we will call the original
DLL, the one with the existing functions that are to be modified, the
first DLL.  The DLL with the enhanced functions will be referred to
as the second DLL.

      The basic function of the DLL merge utility is to append the
code in the second DLL onto the first DLL and then update the EXE
header of the first DLL so that it refers to the enhanced functions.

The enhanced functions in the second DLL fall into one of three
categories.

1.  New function
   2.  Replacement function
   3.  Front end to an existing function

      Some functions in the second DLL may be totally new functions.
That is, they are functions that do not exist in the first DLL.  When
the second DLL is built, the new functions are registered as
non-ordinal exports of the DLL.  Their entry points will be published
in the Resident Names Table in the EXE header of the second DLL.

      The DLL merge utility scans the Resident Names Table of the
second DLL.  For each entry in the table it scans the Resident Names
Table of the first DLL to find a matching entry.  Entries for new
functions in the second DLL will not appear in the Resident Names
Table of the first DLL.  All the utility needs to do for entries for
new functions is copy the information from the Resident Names Table
entry in the second DLL to the Resident Names Table of the first DLL.
This new entry is appended onto the end of the Resident Names Table
of the first DLL.  This action effectively creates an export entry in
the first DLL for the new function.

      Other functions in the second DLL may be total replacements of
functions that e...