Wireshark-dev: Re: [Wireshark-dev] Importing initializers in plugins on Win32
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 28 Feb 2007 10:22:44 -0800
Ulf Lamping wrote:

AFAIK, this is caused as the compiler cannot know the size of this.
So  you *can* use this value inside the plugin (e.g. using val_to_str),
but you cannot use it to *initialize* the hf_register_info.

It shouldn't need to know the size, as you're just taking the address of it. It should be able to know the size, however, as it's just a structure.

However, it may be that Windows' run-time linker (or whatever the code that implements DLLs at run time is called) can't resolve a data reference from a run-time-loaded DLL (a plugin) to a data item from a DLL loaded as a library, so that the compiler can't generate code with the appropriate relocation information for that item, and thus doesn't treat TFS(&flags_set_truth) as a compile-time constant.

I'm not enough of an expert on Windows' run-time linker to say whether that's the case or not.