summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2021-01-07 23:16:10 +0800
committerruki <[email protected]>2021-01-07 23:16:10 +0800
commit8a9dad0bbb9932cf5f5aa5cab10043a784028d53 (patch)
treec910e46b6e7c0399d81976323cbf9762fcf0e39e /core/src
parentbda937a7a86502cdac84dc68b81fde62d6897722 (diff)
improve reg query
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/winos/registry_query.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/xmake/winos/registry_query.c b/core/src/xmake/winos/registry_query.c
index f507bbaab..aadb65b2e 100644
--- a/core/src/xmake/winos/registry_query.c
+++ b/core/src/xmake/winos/registry_query.c
@@ -102,9 +102,10 @@ tb_int_t xm_winos_registry_query(lua_State* lua)
value = (tb_char_t*)tb_malloc0(valuesize + 1);
tb_assert_and_check_break(value);
- // get value result
+ // get value result, we attempt to do not expand value if get failed
type = 0;
- if (s_RegGetValueA(key, rootdir, valuename, RRF_RT_ANY, &type, (PVOID)value, &valuesize) != ERROR_SUCCESS)
+ if (s_RegGetValueA(key, rootdir, valuename, RRF_RT_ANY, &type, (PVOID)value, &valuesize) != ERROR_SUCCESS &&
+ s_RegGetValueA(key, rootdir, valuename, RRF_RT_ANY | RRF_NOEXPAND, &type, (PVOID)value, &valuesize) != ERROR_SUCCESS)
{
lua_pushnil(lua);
lua_pushfstring(lua, "get registry value failed: %s\\%s;%s", rootkey, rootdir, valuename);