diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-08-06 01:11:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:31:25 -0500 |
commit | 8658136f26488d9e9838afc5f2424b9721bc50db (patch) | |
tree | 25c2abdd14a44d3a4b4171a66a25b11114baf445 /testprogs | |
parent | 772d58066dd074b961b39fcdfc01bc956b193cb5 (diff) | |
download | samba-8658136f26488d9e9838afc5f2424b9721bc50db.tar.gz samba-8658136f26488d9e9838afc5f2424b9721bc50db.tar.bz2 samba-8658136f26488d9e9838afc5f2424b9721bc50db.zip |
r9160: use the winreg lib in the test program
(This used to be commit 33bb76ed4e1a796cf68198c0bb480a7bbd31b6cd)
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/ejs/winreg.js | 67 |
1 files changed, 14 insertions, 53 deletions
diff --git a/testprogs/ejs/winreg.js b/testprogs/ejs/winreg.js index 4d8b97d1c2..831528b05c 100755 --- a/testprogs/ejs/winreg.js +++ b/testprogs/ejs/winreg.js @@ -3,6 +3,9 @@ test winreg calls from ejs */ +libinclude("base.js"); +libinclude("winreg.js"); + var options = new Object(); ok = GetOptions(ARGV, options, @@ -31,66 +34,24 @@ if (status.is_ok != true) { return -1; } - - -function list(handle, path, name) { - var io = irpcObj(); - var wtime = new Object(); - wtime.low = 2147483647; - wtime.high = 2147483647; - var keyname = new Object(); - keyname.unknown = 522; - keyname.key_name = NULL; - - var idx = 0; - for (idx=0;idx >= 0;idx++) { - io.input.handle = handle; - io.input.enum_index = idx; - io.input.key_name_len = 0; - io.input.unknown = 1044; - io.input.in_name = keyname; - io.input.class = ""; - io.input.last_changed_time = wtime; - var status = reg.winreg_EnumKey(io); - if (!status.is_ok) return; - var out = io.output; - if (out.result != "WERR_OK") { - return; - } - printf("%s\\%s\n", path, out.out_name.name); - - io = irpcObj(); - io.input.handle = handle; - io.input.keyname = out.out_name.name; - io.input.unknown = 0; - io.input.access_mask = reg.SEC_FLAG_MAXIMUM_ALLOWED; - status = reg.winreg_OpenKey(io); - if (!status.is_ok) return; - assert(io.output.result == "WERR_OK"); - - list(io.output.handle, - path + "\\" + out.out_name.name, - out.out_name.name); +function list_path(path) { + var list = winreg_enum_path(reg, path); + var i; + if (list == undefined) { + return; + } + for (i=0;i<list.length;i++) { + var npath = path + "\\" + list[i]; + println(npath); + list_path(npath); } -} - -function list_tree(name) { - var io = irpcObj(); - io.input.system_name = NULL; - io.input.access_required = reg.SEC_FLAG_MAXIMUM_ALLOWED; - status = reg.winreg_OpenHKLM(io); - assert(status.is_ok); - - var handle = io.output.handle; - - list(handle, "", NULL); } var trees = new Array("HKCR", "HKLM", "HKPD", "HKU"); for (i=0;i<trees.length;i++) { printf("Listing tree '%s'\n", trees[i]); - list_tree(trees[i]); + list_path(trees[i]); } print("All OK\n"); |