lua-users home
lua-l archive

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


Hi Ulrich,

> When my lua program requires "lfs", my proxy dll cant find the previous exported symbol in srlua.exe.
> Question: It is because srlua.exe is open and running? or the proxy dll does not work at all? Looks like there is still something wrong.

Right; this is the same result I get. It seems like the reference
"lua.exe.function" or "lua.function" doesn't resolve to the "lua"
process that is already in memory. I can get it to work for DLLs, but
not for executables.

ProxyDLL4 [1] works for me, but I think it works because it explicitly
uses GetProcAddress and then jumps to that address. It doesn't check
if GetProcAddress returns a valid pointer, so if the function is not
found (for example when it's not exported), the process crashes. I
tried adding a check to show a message in that case, but for some
reason it didn't work. In any case, the proxying itself works, so I'm
using this method for now.

Paul.

[1] http://lua-users.org/wiki/LuaProxyDllFour

Paul.

On Thu, Nov 28, 2013 at 1:58 AM, Ulrich Schmidt <u.sch.zw@gmx.de> wrote:
> Looks like you are right. I did a test compiling srlua.exe statically linked
> and __dllexported. proxy generation looks good.
> When my lua program requires "lfs", my proxy dll cant find the previous
> exported symbol in srlua.exe.
> Question: It is because srlua.exe is open and running? or the proxy dll does
> not work at all? Looks like there is still something wrong.
>
> Ulrich.
>
> Am 28.11.2013 01:38, schrieb Paul K:
>
>> Hi Ulrich,
>>
>>> 1. compile the exe with statically linked runtime and
>>>     __dllextported library functions.
>>>     (your mails sounds like you did this already successfully.)
>>> 2. run "mkproxy myexe.exe lua51" to create the lua51.dll and lua51.lib
>>
>>
>> I did follow this exact process; I also printed the command line for
>> link.exe and it does include a reference to luaL_argerror:
>> /export:luaL_argerror=lua.exe.luaL_argerror, so it's properly exported
>> from lua.exe.
>>
>> I'm not sure how my situation is different from yours. Do you have
>> proxy lua51.dll I can test with?
>>
>>> 3. optional: compile your modules against the new lua51.lib
>>
>>
>> I didn't do this step as I need it to work with any modules compiled
>> against lua51.dll.
>>
>> Paul.
>>
>
> --
> Ulrich Schmidt, 08060 Zwickau, Werdauer Str. 90
> Tel.: +49 (172) 7928 968
>