summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/registry/common/reg_objects.c5
-rw-r--r--source4/lib/registry/tools/regshell.c16
2 files changed, 20 insertions, 1 deletions
diff --git a/source4/lib/registry/common/reg_objects.c b/source4/lib/registry/common/reg_objects.c
index 0109a1f8fe..168ee946e8 100644
--- a/source4/lib/registry/common/reg_objects.c
+++ b/source4/lib/registry/common/reg_objects.c
@@ -93,6 +93,11 @@ uint32 reg_val_type( REG_VAL *val )
/**********************************************************************
*********************************************************************/
+REG_HANDLE *reg_key_handle (REG_KEY *key)
+{
+ return key->handle;
+}
+
char *reg_key_name( REG_KEY *key )
{
return key->name;
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index dbddaa5dcf..b843e91120 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -147,7 +147,21 @@ static REG_KEY *cmd_rmval(REG_KEY *cur, int argc, char **argv)
static REG_KEY *cmd_hive(REG_KEY *cur, int argc, char **argv)
{
- /* FIXME */
+ int i;
+ WERROR error = WERR_OK;
+ for(i = 0; W_ERROR_IS_OK(error); i++) {
+ REG_KEY *hive;
+ error = reg_get_hive(reg_key_handle(cur), i, &hive);
+ if(!W_ERROR_IS_OK(error)) break;
+
+ if(argc == 1) {
+ printf("%s\n", reg_key_name(hive));
+ } else if(!strcmp(reg_key_name(hive), argv[1])) {
+ return hive;
+ }
+ reg_key_free(hive);
+ }
+ return NULL;
}
static REG_KEY *cmd_exit(REG_KEY *cur, int argc, char **argv)