From 969e14eae941427cf36c71b5588d7dd8e1f3c615 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Dec 2004 20:06:40 +0000 Subject: r4155: More destinction between hives and predefined keys (This used to be commit c37d6f3c581673d74e7ec6a644ab6a7d13a55535) --- source4/lib/registry/tools/regdiff.c | 8 ++++---- source4/lib/registry/tools/regshell.c | 25 +------------------------ source4/lib/registry/tools/regtree.c | 4 ++-- 3 files changed, 7 insertions(+), 30 deletions(-) (limited to 'source4/lib/registry/tools') diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index dfa85d636f..8d88cafe59 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -175,15 +175,15 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey, for(i = HKEY_CLASSES_ROOT; i <= HKEY_PERFORMANCE_NLSTEXT; i++) { struct registry_key *r1, *r2; - error = reg_get_hive(h1, i, &r1); + error = reg_get_predefined_key(h1, i, &r1); if (!W_ERROR_IS_OK(error)) { - DEBUG(0, ("Unable to open hive %s for backend 1\n", reg_get_hkey_name(i))); + DEBUG(0, ("Unable to open hive %s for backend 1\n", reg_get_predef_name(i))); continue; } - error = reg_get_hive(h2, i, &r2); + error = reg_get_predefined_key(h2, i, &r2); if (!W_ERROR_IS_OK(error)) { - DEBUG(0, ("Unable to open hive %s for backend 2\n", reg_get_hkey_name(i))); + DEBUG(0, ("Unable to open hive %s for backend 2\n", reg_get_predef_name(i))); continue; } diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 3fd9dab268..47d84c1f62 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -162,28 +162,6 @@ static struct registry_key *cmd_rmval(TALLOC_CTX *mem_ctx, struct registry_key * return NULL; } -static struct registry_key *cmd_hive(TALLOC_CTX *mem_ctx, struct registry_key *cur, int argc, char **argv) -{ - if (!cur->hive->reg_ctx) { - fprintf(stderr, "Only one hive loaded\n"); - return cur; - } - - if (argc == 1) { - printf("%s\n", cur->hive->root->name); - } else { - struct registry_key *newroot; - WERROR error = reg_get_hive_by_name(cur->hive->reg_ctx, argv[1], &newroot); - if (W_ERROR_IS_OK(error)) { - return newroot; - } else { - fprintf(stderr, "Can't switch to hive %s: %s\n", cur->hive->root->name, win_errstr(error)); - } - } - - return NULL; -} - static struct registry_key *cmd_exit(TALLOC_CTX *mem_ctx, struct registry_key *cur, int argc, char **argv) { exit(0); @@ -199,7 +177,6 @@ struct { struct registry_key *(*handle)(TALLOC_CTX *mem_ctx, struct registry_key *, int argc, char **argv); } regshell_cmds[] = { {"ck", "cd", "Change current key", cmd_ck }, - {"ch", "hive", "Change current hive", cmd_hive }, {"info", "i", "Show detailed information of a key", cmd_info }, {"list", "ls", "List values/keys in current key", cmd_ls }, {"mkkey", "mkdir", "Make new key", cmd_mkkey }, @@ -407,7 +384,7 @@ static char **reg_completion(const char *text, int start, int end) if (h) { /*FIXME: What if HKEY_CLASSES_ROOT is not present ? */ - reg_get_hive(h, HKEY_CLASSES_ROOT, &curkey); + reg_get_predefined_key(h, HKEY_CLASSES_ROOT, &curkey); } poptFreeContext(pc); diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 7adeeea731..a6beb2b484 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -124,9 +124,9 @@ static void print_tree(int l, struct registry_key *p, int fullpath, int novals) print_tree(0, root, fullpath, no_values); } else { for(i = HKEY_CLASSES_ROOT; i < HKEY_PERFORMANCE_NLSTEXT; i++) { - error = reg_get_hive(h, i, &root); + error = reg_get_predefined_key(h, i, &root); if (!W_ERROR_IS_OK(error)) { - fprintf(stderr, "Skipping %s\n", reg_get_hkey_name(i)); + fprintf(stderr, "Skipping %s\n", reg_get_predef_name(i)); continue; } print_tree(0, root, fullpath, no_values); -- cgit