lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Here's an analysis of LoadLibrary behavior in Windows builds of Lua: .  I've come to some possible
conclusions on how Windows builds such as LfW should be changed:

  (A) Lua binary modules should have a unique DLL naming convention,
like "foo.luad" or "foo-lua.dll" rather than "foo.dll", to avoid
conflict with non-Lua DLLs. LUA_CPATH can be updated accordingly.

  (B) Something maybe should be done about Lua 5.2.0-beta
LoadLibraryEx triggering undefined behavior [1] with
package.cpath=".\\?.dll". A recommended approach is to make paths
absolute. This may be done via GetFullPathName, though it possibly
leads to corruption in multithreaded and shared library situations [2]
(why shared libraries???).  Alternately, ".\\?.dll" could could be
removed from package.cpath, but the user might still try to add it.