[Pkg-libvirt-commits] [libguestfs] 22/65: v2v: Add support for REG_MULTI_SZ (multiple strings) to registry editor.

Hilko Bengen bengen at moszumanska.debian.org
Tue Apr 21 12:10:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 4fd70eab4ff7d9a8e49db2938a80dcef45db150c
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Tue Apr 7 16:58:40 2015 +0100

    v2v: Add support for REG_MULTI_SZ (multiple strings) to registry editor.
---
 mllib/regedit.ml  | 8 ++++++++
 mllib/regedit.mli | 1 +
 2 files changed, 9 insertions(+)

diff --git a/mllib/regedit.ml b/mllib/regedit.ml
index 673b215..0291fe4 100644
--- a/mllib/regedit.ml
+++ b/mllib/regedit.ml
@@ -30,6 +30,7 @@ and regtype =
 | REG_EXPAND_SZ of string
 | REG_BINARY of string
 | REG_DWORD of int32
+| REG_MULTI_SZ of string list
 
 (* Take a 7 bit ASCII string and encode it as UTF16LE. *)
 let encode_utf16le str =
@@ -97,5 +98,12 @@ and import_value g node = function
     g#hivex_node_set_value node key 3L bin
   | key, REG_DWORD dw ->
     g#hivex_node_set_value node key 4L (le32_of_int (Int64.of_int32 dw))
+  | key, REG_MULTI_SZ ss ->
+    (* http://blogs.msdn.com/oldnewthing/archive/2009/10/08/9904646.aspx *)
+    List.iter (fun s -> assert (s <> "")) ss;
+    let ss = ss @ [""] in
+    let ss = List.map (fun s -> encode_utf16le s ^ "\000\000") ss in
+    let ss = String.concat "" ss in
+    g#hivex_node_set_value node key 7L ss
 
 let reg_import g root = List.iter (import_key g root)
diff --git a/mllib/regedit.mli b/mllib/regedit.mli
index 1f43cdd..985e405 100644
--- a/mllib/regedit.mli
+++ b/mllib/regedit.mli
@@ -47,6 +47,7 @@ and regtype =
 | REG_EXPAND_SZ of string               (** String with %env% *)
 | REG_BINARY of string                  (** Blob of binary data *)
 | REG_DWORD of int32                    (** Little endian 32 bit integer *)
+| REG_MULTI_SZ of string list           (** List of strings *)
 (* There are more types in the Registry, but we don't support them here... *)
 (** Registry value type and data.
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list