Sven Barth wrote:
You are able to define exports from a program. And you can also load
the program binary using LoadLibrary from a library that is already
loaded from that program (because the entry point is not called then),
I'm already calling from a loaded library back into the calling program
using that technique. What happens if a library tries to load a
/different/ program: is the main entry point called and are the
subsidiary entry points available?
I currently only have one answer for that: try it and see what happens.
I have now checked ReactOS' code: if you load an exe that is not the
main executable then the entry point won't be called at all. So it seems
that you can load such executables and call functions from them, but in
the case of FPC you might be screwed (or at least very restricted) as
the initialization sections of the units won't be run (this includes the
system unit which initializes the heap, io, etc.).
Thanks for that, I'm currently looking at the situation on x86 Linux
since I think it's worth progressing this while the thread's fresh.
The fact that the heap etc. wouldn't be initialised had already occurred
to me. Is there any way to fake this?
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus