r9341: updated the winreg test program to take advantage of the new EnumValue
authorAndrew Tridgell <tridge@samba.org>
Wed, 17 Aug 2005 01:40:14 +0000 (01:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:33:26 +0000 (13:33 -0500)
functionality. It now completely enumerates a winreg tree.

This would make a good basis for a js version of regshell if someone
felt like taking that on.

testprogs/ejs/winreg.js

index 22b20739f2792de244c10e38d238658f9bb9a766..2febec801022268a9dac067e27d34411460a3fd8 100755 (executable)
@@ -34,12 +34,21 @@ if (status.is_ok != true) {
        return -1;
 }
 
-function list_path(path) {
-       var list = winreg_enum_path(reg, path);
+function list_values(path) {
+       var list = winreg_enum_values(reg, path);
        var i;
        if (list == undefined) {
                return;
        }
+       for (i=0;i<list.length;i++) {
+               printf("\ttype=%2d size=%4d  '%s'\n", list[i].type, list[i].size, list[i].name);
+       }
+}
+
+function list_path(path) {
+       var list = winreg_enum_path(reg, path);
+       var i;
+       list_values(path);
        for (i=0;i<list.length;i++) {
                var npath;
                if (path) {