[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: loading Lua DLLs from an archive file?
- From: Eike Decker <eike@...>
- Date: Tue, 9 Dec 2008 11:14:32 +0100
This is looking very promising, especially since it comes with source that hands
out the three needed functions:
HMEMORYMODULE MemoryLoadLibrary(const void *);
FARPROC MemoryGetProcAddress(HMEMORYMODULE, const char *);
Though I still wonder how dependencies are resolved (i.e. if DLL A needs also
DLL B). But since it comes with source that can be adjusted (looking right now
at it, I see that it falls back to "LoadLibrary" for such modules, but that
could be forwarded to a different function).
In theory, it should be possible to create a Lua module that replaces the
function "require" and allows calling custom DLL loader functions that could
then retrieve binary DLL data from various places using Lua code - right? If
that's the case, I guess it is doable with a reasonable amount of work.
Anyone else who would be interested in such a Lua module?
> Take a look at:
> On Tue, Dec 9, 2008 at 1:35 AM, Eike Decker <email@example.com> wrote:
> > Hi
> > I want to bundle multiple Lua libraries in a single file (i.e. a ZIP
> > Loading Lua files is not the problem but loading DLLs seems to be
> > I tried looking how to load DLLs from memory or how to create a VFS but
> > seems to go nowhere.
> > There exist applications (http://www.molebox.com/) that can include DLLs
> into a
> > single exe and it is said that these applications load the DLLs from memory
> > not from the file system - so there seems to exist a solution... but I
> > been able to find it till now, or the solution must be quite complex.
> > The alternative would be to leave the DLLs out and distribute the DLLs
> > with the exe - but I would prefer a solution to include all libraries into
> > single archive - without extracting these dlls to a temporary file.
> > Of course I could also link the exe statically with the libraries, but I
> > prefer not to do this and could instead simply wrap the DLLs as they
> > Probably not worth the extra work for the minor advantage of having a
> > psychologically cleaner looking distribution, yet I am interested if and
> > this could be done - otherwise I'll simply put these DLLs alongside with
> > files. Any pointers would be welcome.
> > Thanks
> > Eike