Subj : Forwarder DLLs
To   : Vitus Jensen
From : Andrew Belov
Date : Wed Mar 07 2001 02:50 pm

Hello Vitus!

02 Mar 01 22:22, Vitus Jensen wrote to Andrew Belov:

AB>> There are two approaches here, as I see:

AB>> 1. Create a custom DOSCALL1.DLL and reuse imports from the
AB>> genuine DOSCALL1.DLL for all APIs. This is quite complex since
AB>> not every API is documented and there are specific 16-bit entry
AB>> points/etc. which are hard to reproduce.

VJ> ren DOSCALL1.DLL OLDCALL1.DLL (don't forget the internal DLL name)
VJ> run your own DOSCALL1.DLL which imports from OLDCALL1.DLL?

Exactly. This seems to be the best solution (although it will require some sort
of automation to fix any and all DOSCALL1.DLL regardless of their export
table).

VJ> Whever you are not interested in modifying the way a particular API
VJ> works you can simple let the loader use the entry from OLDCALL1.DLL.
VJ> There is a sample how to do it from Peter Fitzsimmons: look for
VJ> inifix.zip.  All you need are import definitions in you .def file.

Hmmm, it looks like no code is required for the API forwarders. Shame I didn't
know it until now.

AB>> The question is, how can be the method (1) be utilized? Does
AB>> anyone have any experience on substituting DOSCALL1.DLL, or this
AB>> is a very specific task which can't be accompished without a
AB>> major reverse engineering job?

VJ> There is no need for reverse engineering, just code you own version of
VJ> DosOpen().  But I would use method (1): if you make an error just the
VJ> patched apps are affected.

There are too many ones to patch, unfortunately. Not so many people use
LIBC*.DLL or EMXLIBC*.DLL, so almost every executable has its own reference to
DosOpen()... and there are zillions of C libraries as well: LIBC*.DLL,
MMPMCRTS.DLL, REXXCRT.DLL, EMXLIBC*.DLL, ACROCRT.DLL, GUICRT.DLL, ...

VJ> And it will continue to work after applying a fixpak even if there
VJ> are entries added to DOSCALL1.DLL!

The only problem is that it has to be automated somehow. The manual
intervention is not a problem since I already accumulated a rich set of patches
(fixing palette in Cirrus driver, resurrecting the Merlin hibernation feature,
and so on). Have to think twice before I install a new CSD.

                                       Sincerely yours - Andrew

---
* Origin: Conea Software Mail system - Moscow, Russia (2:5020/181.2)