Index: trunk/python2/regfi/pyregfi.h
===================================================================
--- trunk/python2/regfi/pyregfi.h	(revision 202)
+++ trunk/python2/regfi/pyregfi.h	(revision 203)
@@ -37,6 +37,6 @@
 struct TreeIterator_t;
 
-BIND_STRUCT(REGFI_NK_REC)
-BIND_STRUCT(REGFI_VK_REC)
+BIND_STRUCT(REGFI_NK)
+BIND_STRUCT(REGFI_VK)
 BIND_STRUCT(REGFI_DATA)
 
@@ -44,7 +44,7 @@
 CLASS(RawData, Object)
     const REGFI_DATA *data;
-    const REGFI_VK_REC *rec;
+    const REGFI_VK *rec;
 
-    RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK_REC *record);
+    RawData METHOD(RawData, Con, REGFI_DATA *data, REGFI_VK *record);
 
     /** Return the raw buffer as a string. By default we only return
@@ -73,11 +73,14 @@
 				   char **path, REGFI_ENCODING encoding);
 
-/*     struct ValueIterator_t *METHOD(TreeIterator, list_values);*/
-
      void METHOD(TreeIterator, __iter__);
      struct RegistryKey_t *METHOD(TreeIterator, iternext);
 
+
      int METHOD(TreeIterator, down);
      int METHOD(TreeIterator, up);
+
+     struct RegistryKey_t *METHOD(TreeIterator, current);
+     int METHOD(TreeIterator, to_root);
+
 END_CLASS
 
@@ -86,8 +89,8 @@
 CLASS(RegistryKey, Object)
      struct RegistryFile_t *file;
-     const REGFI_NK_REC *key;      /* XXX: temporary */
+     const REGFI_NK *key;
 
      struct RegistryKey_t *METHOD(RegistryKey, Con,
-				  struct RegistryFile_t *file, REGFI_NK_REC *base_key);
+				  struct RegistryFile_t *file, REGFI_NK *base_key);
 
      struct SubkeyIterator_t *METHOD(RegistryKey, subkeys);
@@ -104,5 +107,5 @@
      
      SubkeyIterator METHOD(SubkeyIterator, Con, 
-			   struct RegistryFile_t *file, REGFI_NK_REC *key);
+			   struct RegistryFile_t *file, REGFI_NK *key);
 
      void METHOD(SubkeyIterator, __iter__);
@@ -119,8 +122,8 @@
      
      ValueIterator METHOD(ValueIterator, Con, 
-			  struct RegistryFile_t *file, REGFI_NK_REC *key);
+			  struct RegistryFile_t *file, REGFI_NK *key);
 
      void METHOD(ValueIterator, __iter__);
-     REGFI_VK_REC *METHOD(ValueIterator, iternext);
+     REGFI_VK *METHOD(ValueIterator, iternext);
 END_CLASS
 
Index: trunk/python2/regfi/regfi.c
===================================================================
--- trunk/python2/regfi/regfi.c	(revision 202)
+++ trunk/python2/regfi/regfi.c	(revision 203)
@@ -82,5 +82,5 @@
 
 static RegistryKey RegistryKey_Con(RegistryKey self, 
-				   RegistryFile file, REGFI_NK_REC* base_key)
+				   RegistryFile file, REGFI_NK* base_key)
 {
   if(base_key == NULL)
@@ -191,5 +191,4 @@
 }
 
-
 static int TreeIterator_down(TreeIterator self) 
 {
@@ -205,10 +204,15 @@
 }
 
-/*
-static ValueIterator TreeIterator_list_values(TreeIterator self) 
-{
-  return CONSTRUCT(ValueIterator, ValueIterator, Con, NULL, self);
-}
-*/
+static RegistryKey TreeIterator_current(TreeIterator self)
+{
+  return CONSTRUCT(RegistryKey, RegistryKey, Con, NULL, self->file,
+		   regfi_iterator_cur_key(self->iter));
+}
+
+static int TreeIterator_to_root(TreeIterator self)
+{
+  return regfi_iterator_to_root(self->iter);
+}
+
 
 VIRTUAL(TreeIterator, Object) {
@@ -217,4 +221,6 @@
   VMETHOD(down) = TreeIterator_down;
   VMETHOD(up) = TreeIterator_up;
+  VMETHOD(current) = TreeIterator_current;
+  VMETHOD(to_root) = TreeIterator_to_root;
   VMETHOD(__iter__) = TreeIterator__iter__;
   /*  VMETHOD(list_values) = TreeIterator_list_values;*/
@@ -234,5 +240,5 @@
 static SubkeyIterator SubkeyIterator_Con(SubkeyIterator self, 
 					 struct RegistryFile_t* file, 
-					 REGFI_NK_REC* key)
+					 REGFI_NK* key)
 {
   /* XXX: add a talloc reference? */
@@ -256,7 +262,7 @@
 static RegistryKey SubkeyIterator_iternext(SubkeyIterator self)
 {
-  const REGFI_NK_REC* nk;
-
-  if(self->cur < self->list->num_keys)
+  const REGFI_NK* nk;
+
+  if(self->list != NULL && self->cur < self->list->num_keys)
   {
     /* XXX: can we switch to UTF-8 and have Python properly import that? */
@@ -291,5 +297,5 @@
 static ValueIterator ValueIterator_Con(ValueIterator self,
 				       struct RegistryFile_t* file, 
-				       REGFI_NK_REC* key)
+				       REGFI_NK* key)
 {
   /* XXX: add a talloc reference? */
@@ -312,7 +318,7 @@
 }
 
-static REGFI_VK_REC* ValueIterator_iternext(ValueIterator self)
-{
-  const REGFI_VK_REC* vk;
+static REGFI_VK* ValueIterator_iternext(ValueIterator self)
+{
+  const REGFI_VK* vk;
 
   if(self->list != NULL && self->cur < self->list->num_values)
@@ -386,5 +392,5 @@
 }
 
-static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK_REC *record)
+static RawData RawData_Con(RawData self, REGFI_DATA *data, REGFI_VK *record)
 {
   self->rec = record;
