Commit some more changes ... Start processing the sub-keys, recursively.
authorRichard Sharpe <sharpe@samba.org>
Sun, 8 Dec 2002 19:50:40 +0000 (19:50 +0000)
committerRichard Sharpe <sharpe@samba.org>
Sun, 8 Dec 2002 19:50:40 +0000 (19:50 +0000)
source/utils/editreg.c

index 07de8f42201b17829db416cb6fb82fb9d9388272..86e80e9b4798862e1582bd9064a2b0da216d57dd 100644 (file)
@@ -707,14 +707,23 @@ int valid_regf_hdr(REGF_HDR *regf_hdr)
   return 1;
 }
 
+/*
+ * Process an LF Header and return a list of sub-keys
+ */
+KEY_LIST *process_lf(REGF *regf, LF_HDR *lf_hdr, int size)
+{
+
+  return NULL;
+}
+
 /*
  * This routine is passed a NK_HDR pointer and retrieves the entire tree
  * from there down. It return a REG_KEY *.
  */
-REG_KEY *nt_get_key_tree(NK_HDR *nk_hdr, int size)
+REG_KEY *nt_get_key_tree(REGF *regf, NK_HDR *nk_hdr, int size)
 {
-  REG_KEY *tmp;
-  int rec_size, name_len, clsname_len;
+  REG_KEY *tmp = NULL;
+  int rec_size, name_len, clsname_len, lf_off;
   LF_HDR *lf_hdr;
   VL_TYPE *vl;
   char key_name[1024];
@@ -751,6 +760,23 @@ REG_KEY *nt_get_key_tree(NK_HDR *nk_hdr, int size)
 
   fprintf(stderr, "Key name: %s\n", key_name);
 
+  lf_off = IVAL(&nk_hdr->lf_off);
+
+  /*
+   * No more subkeys if lf_off == -1
+   */
+
+  if (lf_off != -1) {
+
+    lf_hdr = (LF_HDR *)LOCN(regf->base, lf_off);
+    
+    /* Should assign this to something */ 
+    process_lf(regf, lf_hdr, BLK_SIZE(lf_hdr));
+
+  }
+
+  return tmp;
+
 }
 
 int nt_load_registry(REGF *regf)
@@ -811,7 +837,7 @@ int nt_load_registry(REGF *regf)
    * Now, get the registry tree by processing that NK recursively
    */
 
-  regf->root = nt_get_key_tree(first_key, BLK_SIZE(first_key));
+  regf->root = nt_get_key_tree(regf, first_key, BLK_SIZE(first_key));
 
   assert(regf->root != NULL);