I'm trying to create a Gecko 2.0-compatible DLL in Delphi.
Previously (pre-Gecko 2.0) the DLL needed to export a NSGetModule() function. This worked flawlessly.
Starting with Firefox 4, my DLL is getting loaded (I have verified this though a breakpoint in my initialization section), but my NSGetModule() function does not get called anymore. This is the designed behavior because starting with Gecko 2.0 (Firefox 4), a binary component is not supposed to export a NSGetModule() function:
https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0#Binary_components
According to these docs, my DLL needs to export a NSModule data symbol which points to a struct. In Delphi terminology, I assume this is a global variable which points to a Delphi record.
In C++, this is how you export the (global) data symbol:
define NSMODULE_DEFN(_name) extern "C" NS_EXPORT mozilla::Module const *const NSModule
My question: how do I accomplish this in Delphi? How do I export a global variable?
Thanks in advance. I appreciate your feedback.