From bb7879934dca1ef7b26584f4dfadc29462d5a059 Mon Sep 17 00:00:00 2001 From: Saikari Date: Thu, 5 Feb 2026 22:48:58 +0300 Subject: create policy besides pe parser --- core/src/xmake/engine.c | 2 ++ core/src/xmake/winos/set_error_mode.c | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 core/src/xmake/winos/set_error_mode.c (limited to 'core/src') diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 9c02d8487..ccd77e7e5 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -279,6 +279,7 @@ tb_int_t xm_winos_registry_keys(lua_State *lua); tb_int_t xm_winos_registry_values(lua_State *lua); tb_int_t xm_winos_short_path(lua_State *lua); tb_int_t xm_winos_processes(lua_State* lua); +tb_int_t xm_winos_set_error_mode(lua_State *lua); #endif // the utf8 functions @@ -485,6 +486,7 @@ static luaL_Reg const g_winos_functions[] = { { "registry_values", xm_winos_registry_values }, { "short_path", xm_winos_short_path }, { "processes", xm_winos_processes }, + { "seterrormode", xm_winos_set_error_mode }, { tb_null, tb_null }, }; #endif diff --git a/core/src/xmake/winos/set_error_mode.c b/core/src/xmake/winos/set_error_mode.c new file mode 100644 index 000000000..43131d2e2 --- /dev/null +++ b/core/src/xmake/winos/set_error_mode.c @@ -0,0 +1,7 @@ +#include "prefix.h" + +tb_int_t xm_winos_set_error_mode(lua_State *lua) { + tb_size_t mode = (tb_size_t)luaL_checkinteger(lua, 1); + lua_pushinteger(lua, (tb_int_t)SetErrorMode((UINT)mode)); + return 1; +} -- cgit v1.3.1