Author Topic: Presentation Manager - About PM DLL's  (Read 10279 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Presentation Manager - About PM DLL's
« on: March 04, 2015, 10:50:50 pm »
Hi

I'm trying to document a little bit more about Presentation Manager on EDM/2. 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.

But I still have some question about some PM DLL's.

For example, if you take the "WinInitialize" function, you can see that is included in two DLLs, PMMerge.DLL and PMWIN.DLL.

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.
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Presentation Manager - About PM DLL's
« Reply #1 on: March 05, 2015, 05:42:32 am »
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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Presentation Manager - About PM DLL's
« Reply #2 on: March 05, 2015, 05:51:29 pm »
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" are included on "PMMERGE.DLL"
2) If I check PMWin.DLL with PMDLL application, it points to PMMERGE.DLL

Any thoughts?

« Last Edit: March 05, 2015, 10:12:58 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Presentation Manager - About PM DLL's
« Reply #3 on: March 06, 2015, 03:55:55 am »
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.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Presentation Manager - About PM DLL's
« Reply #4 on: March 06, 2015, 06:02:43 am »
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.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Presentation Manager - About PM DLL's
« Reply #5 on: March 08, 2015, 09:56:03 pm »
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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Presentation Manager - About PM DLL's
« Reply #6 on: March 08, 2015, 10:48:19 pm »
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
« Last Edit: March 09, 2015, 12:07:05 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +5/-0
    • View Profile
Re: Presentation Manager - About PM DLL's
« Reply #7 on: March 09, 2015, 01:01:27 pm »
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...

Quote
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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Presentation Manager - About PM DLL's
« Reply #8 on: March 11, 2015, 06:58:18 pm »
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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Presentation Manager - About PM DLL's
« Reply #9 on: March 20, 2015, 06:41:59 pm »
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.

Quote
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
« Last Edit: March 20, 2015, 06:51:00 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

dbanet

  • Guest
Re: Presentation Manager - About PM DLL's
« Reply #10 on: March 23, 2015, 10:07:22 pm »
Martin, to replace dynamic-link library files that are loaded into memory, please use unLock.exe from the lxLite package:
Code: [Select]
┌[ 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