Advertisement
captmicro

Untitled

Dec 1st, 2012
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. typedef int (*lls_t)(lua_State *, const char *);
  2. typedef int (*lpc_t)(lua_State *, int, int, int);
  3.  
  4. int RunLua(lua_State *L, char *str)
  5. {
  6.     lls_t LuaLoadStr = (lls_t)GetProcAddress(GetModuleHandle("lua_shared.dll"), "luaL_loadstring");
  7.     lpc_t LuaPCall = (lpc_t)GetProcAddress(GetModuleHandle("lua_shared.dll"), "lua_pcall");
  8.     return (LuaLoadStr(L, str) || LuaPCall(L, 0, LUA_MULTRET, 0));
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement