Xref: news2.mv.net comp.os.msdos.djgpp:1390 From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: dxe files? Date: Sat, 24 Feb 1996 09:51:09 CST Organization: Rice University, Houston, Texas Lines: 32 Message-ID: <312f33ed.sandmann@clio.rice.edu> References: <4gjuq1$k1k AT terra DOT mpikg-teltow DOT mpg DOT de> Reply-To: sandmann AT clio DOT rice DOT edu NNTP-Posting-Host: clio.rice.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > Is there any way to have more than one entry point in a dxe file? Yes, one way is to to create a structure which contains the pointers to the entry points and/or variables. You then return the pointer to the structure when building the DXE. When I create such a structure, I usually include version and size fields, so I can add more things to the loadable module in the future, and still remain backward compatible with other modules which only use the first few pointers in the DXE structure. > Can the dxe module access global variables of the calling program > or vice versa? You can access global variables in the dxe module (see above), but the dxe module cannot access variables (or routines) in the main code. This design limitation was intentional to keep DXEs as simple as possible. The code to load a DXE is very tiny (a few hundred bytes) and was suitable for including in every DJGPP V2 image (to load the emu387 if needed). A full DLL package would have features not needed and take several thousand bytes of space in every image. > If neither was possible, how to build a dynamic link library? There are lots of ways to attack it (and there are a few prototypes out there). The most advanced code that I remember worked for just about everything except for some writeable variables we had in the text area. I had an idea to fix that problem, but I never got around to it, and it might be fixed by now (that was like 6 months ago, sigh). Eventually, it would be nice to put almost all of the libc into a DLL to have the potential for dynamic linking (easy bug fixes, smaller images, etc) for programs not needing to be distributed.