You must remove/change
/*char buffer[128];
if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error, 0, buffer, sizeof(buffer)/sizeof(char), NULL))
lua_pushstring(L, buffer);
else*/
in order to make LUA WinRT-compatible. The "FormatMessageA" is a Win32 call which is not present in the Windows's 8 WinRT API.
Thanks.