ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] Can't compile Ethereal from current CVS on Windows.

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 11 Sep 2003 01:53:46 -0700
On Mon, Aug 25, 2003 at 07:24:22PM +0200, Gisle Vanem wrote:
> When was this true? An .exe-file can export symbols just as easily as an
> DLL can. But it AFAIK requires all exported and imported symbols be marked 
> correctly. Something like:
> 
> #if defined(WIN32)
>   #if defined(BUILDING_PLUGIN)
>     #define ETR_API __declspec (dllimport)
>   #else
>     #define ETR_API __declspec (dllexport)
>   #endif
> #else
>   #define ETR_API 
> #endif

A page at MSDN says:

	Pros and Cons of Using __declspec(dllexport)

	Using __declspec(dllexport) is convenient because you do not
	have to worry about maintaining a .DEF file and obtaining the
	decorated names of the exported functions.  However, you do not
	have control over the export ordinals that the compiler
	generates.  This method is suitable if, for example, you are
	designing a DLL for use with an application that you control; if
	you rebuild the DLL with new exports, you will also have to
	rebuild the application.

So if you replace "DLL" with "application" and "application" with "DLL",
is that also true?

I.e., does it mean that the plugin interface changes in a
non-binary-compatible fashion if we do something that changes the export
ordinals for functions exported by Ethereal?

If so, could we work around that by having a .def file for the
executable image?  That means we still have to have, on Windows, a list
of the functions in the plugin API; however, the list only has to give
the name and an ordinal - there's no need for the function prototype.