OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Martin Iturbide on March 04, 2015, 10:50:50 pm
-
Hi
I'm trying to document a little bit more about Presentation Manager on EDM/2 (http://www.edm2.com/index.php/Presentation_Manager). This is also focused for me to understand more how are the Presentation Manager DLL's structured with the hope to have more documentation. First I'm trying to list which are the files that are part of PM, so I'm comparing what OSFree says is the PM API (http://sourceforge.net/p/osfree/code/HEAD/tree/trunk/OS2/PM/API/l).
But I still have some question about some PM DLL's.
For example, if you take the "WinInitialize (http://www.edm2.com/index.php/OS2_API:WinInitialize)" function, you can see that is included in two DLLs, PMMerge.DLL (http://www.edm2.com/index.php/PMMERGE.DLL) and PMWIN.DLL (http://www.edm2.com/index.php/PMWIN.DLLl).
I had been told that this is because some DLL are forwarders to other DLL, in this case it may mean (I guess on my limited understanding) that the source code of the function is included on PMMERGE.DLL and PMWIN.DLL just forward the application asking for "WinInitialize".
Maybe this is a very basic question but, which is the value of DLL forwarders on this case? does PMWIN.DLL has some intelligence (source code) when refereeing to "WinInitialize"? or does all the work is done on PMMERGE.DLL?
I really do not know if some DLL Forwarders does not have any logic inside and just send all the work to PMMERGE? or if I'm completely misunderstanding how the DLLs works on PM and on OS/2.
Regards.
-
Not an expert and just guessing but at one time the PM was 16 bit so programs written for OS/2 1.x may call different DLLs and the call may be thunked into 32 bit and then forwarded to the 32 bit DLL.
-
Thanks for the reply Dave. Your guessing for a reason to this "forwarders" is very valid.
I want to try to support a thesis that PMWin.DLL is a forward that is has not logic on it, and that can be easily cloned/replaced since PMMerge.DLL is the one that does all the work. but I don't know for sure how to support this thesis.
1) I checked and it looks that all the functions pointed on "PMWIN.DLL (http://www.edm2.com/index.php/PMWIN.DLL)" are included on "PMMERGE.DLL"
2) If I check PMWin.DLL with PMDLL application, it points to PMMERGE.DLL
Any thoughts?
-
I was thinking it may have had logic to thunk the code, meaning translating from 16 bit to 32 bit and back but looking closer it does seem to be nothing but a forwarder dll with pmmerge having the 16bit entry points. Some programs must have been linked against pmwin instead of pmmerge and the main reason I can think of is OS/2 v1.x.
Use exehdr to examine them and other executables which includes DLLs, exehdr comes with the toolkit and you'll need to pipe it through something like less.
-
I found some OS/2 1.x PM applications (actually dual OS/2 and Win 3.0, they run under OS/2 ver 4 but hang eCS 2.1) and they use PMWIN.DLL.
-
Plain Forwarder DLLs contain no code but just references to other DLLs which actually implement the function. The loader that loads the executable that in turn loads the forwarder DLL will replace the entry points in the executable not by the entry point of the forwarder DLL but rather by the entry point of the DLL the forwarder DLL refers to (after all that is the purpose of a forwarder DLL).
Why ? Well maybe because the designers of PM decided to stuff everything into a single DLL "PMMERGE.DLL". But at that point in time there where multiple applications around that referred to file "PMWIN.DLL" (and others like "PMDRAG.DLL" for example) instead. In order to ensure that those applications would continue to work, "PMWIN.DLL" was made a forwarder DLL.
By the way: libc also follows this concept, libc*.dll are all forwarder DLLs except for the latest version that you have installed. You can tell by the file size: the latest version of libc*.dll is about 1.3 MBytes in size while the others are only 150 kByte or less in size. At least they started doing this with version libc06.dll.
-
Thanks for the reply Lars.
Just one some questions, how do I recognize that a DLL is only a plain forwarder?
Do you know of any forwarder on OS/2 that has something inside (that is not plain) ? like half forwarder and half "implemented functions" on it? Do something like that exist right now on OS/2?
Regards
-
Just one some questions, how do I recognize that a DLL is only a plain forwarder?
You could check with lxlite or exehdr etc. to see if all of the entrypoints are forwarded. Although I'm not certain that covers all possibilities...
Do you know of any forwarder on OS/2 that has something inside (that is not plain) ? like half forwarder and half "implemented functions" on it? Do something like that exist right now on OS/2?
Yes, certainly. The replacement LVM.DLL in eCS, for example.
-
Thanks for the reply.
I want to try to document the OS/2 DLL's (and other files) by it's components (like PM, SOM, WPS, Control Program) on EDM/2.
Let's if it can be improved, for the moment is this page: http://www.edm2.com/index.php/OS/2_DLL_Entry_Points
Regards
-
Hi
I made an experiment with my experimental eCS 2.1 VM to see if the systems keeps working fine after replacing some DLL that are forwardes by other generated by OSFree project some years ago.
Here are the files that that OSFree has compiled in the past, and that I used to replace the old ones.
9-17-11 6:13a 463 0 a--- ansicall.dll
9-17-11 6:13a 412 0 a--- bkscalls.dll
9-17-11 6:13a 409 0 a--- bmscalls.dll
9-17-11 6:13a 465 0 a--- bvscalls.dll
1-25-12 4:57p 904 0 a--- kbdcalls.dll
9-17-11 5:13a 693 0 a--- moncalls.dll
1-25-12 4:58p 1,040 0 a--- moucalls.dll
2-02-12 10:26a 627 0 a--- msg.dll
9-17-11 6:13a 754 0 a--- nampipes.dll
2-02-12 10:27a 589 0 a--- nls.dll
9-17-11 6:13a 689 0 a--- os2char.dll
9-17-11 6:15a 2,412 0 a--- pmdrag.dll
9-17-11 6:15a 2,216 0 a--- pmgre.dll
9-17-11 6:15a 479 0 a--- pmmle.dll
9-17-11 6:15a 4,511 0 a--- pmshapi.dll
2-02-12 2:16p 19,713 0 a--- pmwin.dll
2-02-12 3:21p 761 0 a--- quecalls.dll
1-25-12 4:59p 2,040 0 a--- viocalls.dll
I renamed the original OS/2 files and change them for this one generated by OSFree and the system boots and run withouts any issue. I still haven't found any visible problem.
I was not able to replace "sesmgr.dll" since it is still loaded on memory even if I boot on "ALT F1" command prompt mode.
And I'm not sure what "startlw.dll" is for. I was not able to find it on my system.
So, I think this files I replaced are forwarders only and can easily be replaced just like OSFree project showed me.
Does anybody can point some issue or warning about replacing this files?
Regards
-
Martin, to replace dynamic-link library files that are loaded into memory, please use unLock.exe from the lxLite package (http://hobbes.nmsu.edu/h-viewer.php?dir=/pub/os2/util/archiver&file=lxlt133.zip&backto=%2Fh-search.php%3Fsh%3D1%26button%3DSearch%26key%3Dlxlite%26stype%3Dall%26sort%3Dtype_name%26dir%3D%252F):
┌[ unLock ]──────────────────────────────[ Version 1.3.3 ]┐
├ Copyright 1996 by FRIENDS software ─ No rights reserved ┘
├ Usage: unLock [FileMask( FileMask)] {[?|-]Options}
├ /P{+|-} Enable (+) or disable (-) pause before each file
├ /R{+|-} [R]ecursive (+) file search through subdirectories
├ /V{+|-} Verbose (show additional information)
├ /?,/H Show this help screen
├┤Default: /P- /R- /V-
└┤Example: unLock d:\*.exe d:\*.dll /r