TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Denis Tonn
from: Jonathan de Boyne Pollard
date: 1998-09-21 13:06:30
subject: How do DLLs load and unload ?

I'm trying to figure out something, part of which you, with your knowledge
of the internals of OS/2, may be able to help me with.

How are DLLs loaded and unloaded ?  In particular, how does OS/2 Warp keep
track of which DLL_InitTerm functions it needs to call when executing
DosFreeModule ?  It seems to me that there is a chicken-and-egg problem
here.  It cannot know which InitTerm functions to call before it starts
unloading modules from the address space, but it cannot unload the modules
from the address space since they must remain mapped so that their InitTerm
functions can be called.  How does OS/2 solve this ?

If you are about to tell me that OS/2 uses callbacks into ring 3 from ring
0 in order to call the InitTerm functions, how does it *return* from those
callbacks into ring 0 ?  And how does it cope with the pathological, but
permissible, case that the InitTerm function of a module may itself call
DosLoadModule or DosFreeModule ?  Or the equally pathological case that the
InitTerm function, either accidentally or deliberately, never returns at
all (leaving the kernel internals in an intermediate state) ?

 ¯ JdeBP ®

--- FleetStreet 1.19 NR
* Origin: JdeBP's point, using Squish (2:440/4.3)
SEEN-BY: 396/1 622/419 632/0 371 633/210 260 267 270 371 635/506 728 639/252
SEEN-BY: 670/218
@PATH: 440/4 255/1 251/25 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.