Andrew Begel wrote:
On Wednesday, October 24, 2001, at 09:37 PM, Stephen J. Turnbull wrote:
>
> Isn't this an abuse of PATH searching? PATH searching is intended to
> provide a way for applications to find executable code that they
> _don't_ provide themselves. But you already know where those DLLs
> are, you found the ELL (XEmacs-specific DLL) there, right? This works
> fine for XEmacs itself, and has the additional advantage of avoiding
> version skew (or breakage of delay-loaded modules) if the user should
> do something like manipulate PATH themselves.
>
> Or the ELL could just call the platform's setenv(3) itself. This has
> its own problems, namely possible name conflicts for other ELLs that
> abuse PATH searching in the same way. But since you're changing the
> fundamental assumption that XEmacs makes about `process-environment'
> anyway, why not? This has the advantage from my point of view that
> _all_ non-module XEmacs functionality will work the same way it ever
> did, because your PATH-munging will be totally ignored by XEmacs.
>
There's one flaw in the logic. The above argument assumes that the ELL
is loading dependent DLLs via dlopen() (LoadLibrary() on Win32).
However, if you've merely mentioned the dependent DLL on the link line
for the ELL, Windows will load the dependent DLLs automagically as a
result of said dlopen() call. Thus, there's no time/place for the ELL to
modify the PATH, since it's not completely loaded by Windows yet, and
therefore can't run any of its own code.
> I don't much like this off-hand. It will be another gratuitous API
> incompatibility with GNU Emacs. What's wrong with just defining new
> primitive functions, say `{get,set}-real-environment', and in a module
> of their own? Also, why impose the extra path in PATH on subprocesses
> etc that just don't care about your DLLs? See above.
The alternative, suggested a few messages back, is that our application
installer modify the user's PATH during the installation process --
which effectively leads to the same effect as your last question in the
above paragraph. We impose the extra PATH on all Windows applications
that don't care about our DLL instead of just XEmacs. :)
Well, munging the Autoexec.bat file and telling/forcing the user to
reboot is very common in Windoze (thru 98 anyway). Lots of "big names"
do that. The simplest way, if you've been careful with your dll names,
would be to park them in %windir%\SYSTEM because that is always searched.
The *first* directory searched when a *.exe references a .dll is the
directory from which Win loaded the .exe. I don't know what that means
when you do your own load. It would be nice if it were the same
directory from which the manually-loaded dll came; but Bill ain't that
friendly.
If it were me, I think I'd put all the dll's into a single library
directory and make sure that's in my path.
I'm not even sure that the system loader would honor changes to your
*own* environment block that are made after you are loaded; it might be
using the environment you were initially passed.
--
David A. Cobb, Software Engineer, Public Access Advocate, All around
nice guy.
New PGP key 09/13/2001:
:<http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=superbiskit&\
fingerprint=on>
:<http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=superbiskit&\
fingerprint=on>
Fingerprint=0x{E7C6_4EE2_6B75_5BA3_C52E__77FA_63C3_9366_DCFB_229B}
"By God's Grace I am a Christian man, by my actions a great sinner."
--The Way of a Pilgrim, R. M. French [tr.]
Potentially Viral Software is any software for which you are not allowed
to examine the source. Do not buy or use Potentially Viral Software!