Author Topic: DLL names, and re-direction?  (Read 5338 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1355
  • Karma: +26/-0
    • View Profile
DLL names, and re-direction?
« on: April 22, 2023, 09:38:22 pm »
As Paul has been building the QT stuff he noted the OS/2 DLL name limitations.

This morning I was reading a security paper on Google One VPN and DLL redirection was highlighted as one of the findings (LOW impact).

Anyways, this remark was applicable to the Win binaries, but it did have a link to a MSDN article (https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-redirection), so off I went reading wondering how Gates&Co solved this issue.

So while the redirection issue and the Win functionality to implement such a thing does not solve our problem, that made me think: so why not construct our very own re-direct DLL to help us deal with the existing limitations?

Basically a wrapper DLL.

Would it not be feasible to maintain a system-wide manifest that lists all installed DLLs, and for those that need to be longer than the 8 chars limitation we simply provide a virtual DLL name that the wrapper maps to and passes that onto the standard OS/2 DLL loader?

...or am I misunderstanding the nature of the OS/2 limitiation?

Andy Willis

  • Sr. Member
  • ****
  • Posts: 307
  • Karma: +7/-0
    • View Profile
Re: DLL names, and re-direction?
« Reply #1 on: April 22, 2023, 09:53:34 pm »
There has existed a way to accept non 8.3 DLL names for two decades?  win32k.sys with Odin has:
OS/2 Loader parameter:
-Dllfixes<:E|:D>
                Enables or Disables the long DLL name and non .DLL
                extention fixes. OS/2 DLLs have been limited to 8 chars
                names since version 2.<something>. This is a very bad
                limitation. Also OS/2 forces all DLL loaded to loadtime
                to have the extention '.DLL'.
                Both these restrictions are removed if this option is
                enabled.
                For DLL with non .DLL extention the internal name must
                have to the extention included. (If you the experiences
                problems with IMPLIB.EXE, enclose the internal name
                in double-quotes.)
                You should not make a DLL with a name starting with
                DOSCALLS, DOSCALLS1, IBMVGA32, IBMDEV32 or IBMXGA32.
                Current state for this feature is EXPERIMENTAL.
                Default: Enabled

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1355
  • Karma: +26/-0
    • View Profile
Re: DLL names, and re-direction?
« Reply #2 on: April 23, 2023, 03:47:04 pm »
Andy,
Does that functionality apply to Odin processing only? Or is this a system-wide enablement?

Andy Willis

  • Sr. Member
  • ****
  • Posts: 307
  • Karma: +7/-0
    • View Profile
Re: DLL names, and re-direction?
« Reply #3 on: April 23, 2023, 06:34:56 pm »
Andy,
Does that functionality apply to Odin processing only? Or is this a system-wide enablement?
System wide.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5027
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DLL names, and re-direction?
« Reply #4 on: April 24, 2023, 02:41:11 am »
Hi

I'm not sure if it is "DLL redirection" but I had been always interested on that subject, but with the focus to try to clone as open source the OS/2 API.

I'm not sure if I'm talking nonsense, but there were some kind of "redirection" on the past with this projects:
- https://github.com/OS2World/DEV-SAMPLES-Newcalls   "Example of how to redirect (or "hook") a function in a dll that you don't have the code for."
- https://hobbes.nmsu.edu/download/pub/os2/system/patches/mixed/NewCalls_1-04.zip
- https://github.com/OS2World/DEV-SAMPLES-CPI-DOSBeep_Replacement -  Replace DosBeep to play a sound via MMPM instead of PC speaker.

Maybe this projects can help with the idea.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.