[Libguestfs] [PATCH] hivex: add hivex_set_value api call

Richard W.M. Jones rjones at redhat.com
Sat Jul 3 17:42:09 UTC 2010


On Sat, Jul 03, 2010 at 09:22:20AM -0700, Conrad Meyer wrote:
> I'm not entirely sure the generator/generator.ml changes are as correct
> as they could be. I'm not very familiar with Caml.

Well you can add OCaml to your CV now, because your code is fine ...

> The hivex_node_set_value call builds up a list of hive_set_values by
> walking the existing values at the node, adding or replacing the passed
> hive_set_value as necessary, then shoving the list at
> hivex_node_set_values.
> 
> Not included: Perl or OCaml binding glue.

Are you intending to go further with this?  The most crucial missing
part is the tests.  We test via Perl code, so this implies a Perl
binding (should be very easy to add).

Have you loaded up files that you've modified this way on Windows?
Subtle mistakes (more accurately: things which the hacked-together
Windows code is not expecting) can cause registries to be silently
corrupted.

I had a quick look at the code and the only mistake I could spot is:

> +    if (strcmp (valkey, val->key) == 0)

First of all use the STR* macros, secondly everything in registry
files that is visible externally is matched case *in*sensitively.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html




More information about the Libguestfs mailing list