Closed Bug 608945 Opened 15 years ago Closed 15 years ago

NSModule in a dll built with Delphi won't get initialized

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: devel, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7 Build Identifier: FireFox 3.6 Recently NSGetModule has been changed into NSModule, to avoid running code from the DLL when registering. DLL's built with Delphi require to have at least some code run to initialize the NSModule structure. I've built an Apache 2 DLL with Delphi, this works with an exported struct also, and there the initialization code does get called. Is there a way to either have a specific export from the DLL that gets called on registration only, or to provide the specific data registration would need from NSModule completely apart from the DLL (e.g. in the xpi manifest XML?) Reproducible: Always Steps to Reproduce: 1. Try to export NSModule from a Delphi DLL project. 2. firefox.exe doesn't the DLL's initalization code. Actual Results: firefox hangs, the plugin isn't able to respond Expected Results: firefox uses the plugin I'm still porting nsModule.h to Object Pascal, I'll commit sometime soon here http://xxm.svn.sourceforge.net/viewvc/xxm/trunk/Delphi/gecko/
You should be able to use a static initializer to perform actions during DLL load. e.g. static int kDummyInt = MyInitializerFunc(); Or even extern "C" const mozilla::Module NSModule = GetModulePointer(); // do initialization in GetModulePointer.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
I've been trying. I've been debugging my DLL with firefox as host process, but the library's start code isn't called. Either nothing happens, or access violations occur... I'm trying to find where the DllMain export is in Delphi's core units, to try and set a breakpoint there, but still if that doesn't even gets called, there's still something not working there like it should.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Found it. My debugger had a wrong setting, I get my initialization code called now, so I can start checking if I ported module.h all right. Thing still is, if NSModule doesn't load properly from a DLL, firefox just sits there showing nothing, do you want me to open a new ticket to check where the error handling is gone on that one, or do you want me to change this ticket?
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → WORKSFORME
No, I want you to debug the problem yourself, and post questions to mozilla.dev.extensions if necessary. Unless you have a known bug in the Mozilla platform, a bug here won't track anything useful.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.