Ethereal-dev: Re: [Ethereal-dev] Patch for better finding of plugins under Win32

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sat, 18 Aug 2001 17:44:49 -0700
On Wed, Aug 15, 2001 at 09:36:21AM +0200, Dr.-Ing. Gerrit Gehnen wrote:
> Attached you find a patch for epan\plugins.c to replace the hardcoded
> path c:\Program Files... with a path derived from the argv[0] argument,
> pointing to the actual location of ethereal.exe.
> That should fix any problems with finding the plugins under Win32.

Not all problems - in some cases, "argv[0]" isn't an absolute pathname.

On Win32, you can get the absolute pathname of the currently running
program by calling "GetModuleFileName()" with a null pointer as the
first argument; I've checked in a change to use that, in Win32, to guess
what the installation directory is.  (It's only a guess; it also
searches "C:\Program Files\Ethereal\plugins\{version}", if it finds it,
so that if you've installed plugins there, and are running Ethereal from
a source directory in which you've built it, it'll find the plugins
there.)