lua-users home
lua-l archive

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


Duncan Cross wrote:
> One thing - I'm not certain this is related to the addition of
> callbacks, but I was just experimenting with Win32 calls and found
> that GetLastError() seems to return the wrong value (127,
> ERROR_PROC_NOT_FOUND) the first time it's called. This is a minimal
> test case:
> 
>   local ffi = require("ffi")
> 
>   ffi.cdef [[
>   uint32_t GetLastError();
>   void SetLastError(uint32_t code);
>   ]]
> 
>   ffi.C.SetLastError(0)
>   print(ffi.C.GetLastError()) -- 127
>   ffi.C.SetLastError(0)
>   print(ffi.C.GetLastError()) -- 0

Sorry, I forgot to save the error value around ffi.load() and
symbol resolving.

Thank you for the report! Fixed in git HEAD.

--Mike