summaryrefslogtreecommitdiff
path: root/xmake/core/sandbox/modules/winos.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-26 00:43:58 +0800
committerruki <[email protected]>2020-12-26 00:43:58 +0800
commit9dd609f518388f7c62e241e7f1d5813df0ada6b1 (patch)
tree7b48cd4dadc2d756b562ac94fa1c98b8f7f1bb84 /xmake/core/sandbox/modules/winos.lua
parentd9fb6826a45caafc94772ba63c87a3d2f023867e (diff)
improve registry
Diffstat (limited to 'xmake/core/sandbox/modules/winos.lua')
-rw-r--r--xmake/core/sandbox/modules/winos.lua28
1 files changed, 27 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/winos.lua b/xmake/core/sandbox/modules/winos.lua
index 1726897f8..0a8058a75 100644
--- a/xmake/core/sandbox/modules/winos.lua
+++ b/xmake/core/sandbox/modules/winos.lua
@@ -31,7 +31,6 @@ sandbox_winos.ansi_cp = winos.ansi_cp
sandbox_winos.cp_info = winos.cp_info
sandbox_winos.console_cp = winos.console_cp
sandbox_winos.console_output_cp = winos.console_output_cp
-sandbox_winos.registry_query = winos.registry_query
sandbox_winos.logical_drives = winos.logical_drives
sandbox_winos.cmdargv = winos.cmdargv
@@ -44,6 +43,33 @@ function sandbox_winos.version()
return winver
end
+-- query registry value
+function sandbox_winos.registry_query(keypath)
+ local value, errors = winos.registry_query(keypath)
+ if not value then
+ raise(errors)
+ end
+ return value
+end
+
+-- get registry keys
+function sandbox_winos.registry_keys(pattern)
+ local keypaths, errors = winos.registry_keys(pattern)
+ if not keypaths then
+ raise(errors)
+ end
+ return keypaths
+end
+
+-- get registry values
+function sandbox_winos.registry_values(keypath)
+ local values, errors = winos.registry_values(keypath)
+ if not values then
+ raise(errors)
+ end
+ return values
+end
+
-- return module
return sandbox_winos