Article View: comp.os.os2
Article #596Re: Massaging PMWIN.DLL?
From: Derek Baum - Sun PC Distributed ...
Date: Fri, 04 May 1990 14:39
Date: Fri, 04 May 1990 14:39
53 lines
2668 bytes
2668 bytes
In article <6860001@hp-ptp.HP.COM> barbh@hp-ptp.HP.COM (Barbara Holden) writes:
>I need to replace some of the standard functions in PMWIN.DLL with some
>handtailored ones of my own. Is there any other way of doing besides
>generating a new PMWIN.DLL that contains stub calls to the "real"
>PMWIN.DLL (renamed) for all non-tailored functions?
>Is the above even feasible?
>
>Comments, advice are eagerly solicited. Thanks alot!
It is indeed feasible to generate a new PMWIN.DLL as you suggest
(I've done it for PMGPI.DLL), but there are a number of problems:
problem #1: is due to the number of exports: on OS|2 1.2 PMWIN.DLL
exports 311 functions! If you only wanted to tailor one function you
would have to write stubs for the remaining 310!
problem #2: is that the real PMWIN.DLL cannot simply be renamed,
since it has its module name embedded in its newexe header.
problem #3: is that some of the exports are not documented:
on OS|2 1.2 PMWIN.DLL exports 25 undocumented functions, for example:
GETSCREENSELECTOR, FARCALLHOOK, STARTTIMER, ABNORMALPROCESSEXIT.
It is difficult to create stubs for undocumented functions.
I have managed to automate the process for creating such stub DLLs,
since I needed to obtain trace information from undocumented DLL functions.
solution #1: generate stubs automatically
solution #2: use objexit.exe, a sed look-alike for binary files.
solution #3: stubs pass 32 words of parameters to undocumented functions
and then clean unused parameters from the stack
The mechanics work as follows:
dxgen c:\os2\dll\pmwin.dll
# creates pmwin.def, pmwin.c, pmwin.mk
pmwin.c can be edited to set the actual number of parameters
and trace format for known functions.
make pmwin.mk
# copies real pmwin.dll to p_win.dll and edits internal module name
# builds stub pmwin.dll which traces parameters and then calls p_win.dll
# pmwin.c can be edited to remove the functions that require special
# tailoring.
--
Derek Baum consulting at:
Sun Microsystems Internet: dbaum@East.Sun.COM
(508)671-0456 UUCP: ...!sun!suneast!dbaum
Technical Details
Message-ID:
<1841@east.East.Sun.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!philmtl!philabs!gotham!east!camilla!dbaumReferences:
<6860001@hp-ptp.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!philmtl!philabs!gotham!east!camilla!dbaum From: dbaum@camilla.East.Sun.COM (Derek Baum - Sun PC Distributed Systems) Newsgroups: comp.os.os2 Subject: Re: Massaging PMWIN.DLL? Message-ID: <1841@east.East.Sun.COM> Date: 4 May 90 14:39:06 GMT References: <6860001@hp-ptp.HP.COM> Sender: news@east.East.Sun.COM Reply-To: dbaum@camilla.East.Sun.COM (Derek Baum - Sun PC Distributed Systems) Organization: Sun Microsystems, Billerica MA Lines: 53