summaryrefslogtreecommitdiff
path: root/source3/utils/net_registry_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_registry_util.c')
-rw-r--r--source3/utils/net_registry_util.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/source3/utils/net_registry_util.c b/source3/utils/net_registry_util.c
index a3b84a344f..7cbf238aeb 100644
--- a/source3/utils/net_registry_util.c
+++ b/source3/utils/net_registry_util.c
@@ -41,30 +41,46 @@ void print_registry_value(const struct registry_value *valvalue, bool raw)
str_regtype(valvalue->type));
}
switch(valvalue->type) {
- case REG_DWORD:
+ case REG_DWORD: {
+ uint32_t v = 0;
+ if (valvalue->data.length >= 4) {
+ v = IVAL(valvalue->data.data, 0);
+ }
if (!raw) {
d_printf(_("Value = "));
}
- d_printf("%d\n", valvalue->v.dword);
+ d_printf("%d\n", v);
break;
+ }
case REG_SZ:
- case REG_EXPAND_SZ:
+ case REG_EXPAND_SZ: {
+ const char *s;
+
+ if (!pull_reg_sz(talloc_tos(), &valvalue->data, &s)) {
+ break;
+ }
if (!raw) {
d_printf(_("Value = \""));
}
- d_printf("%s", valvalue->v.sz.str);
+ d_printf("%s", s);
if (!raw) {
d_printf("\"");
}
d_printf("\n");
break;
+ }
case REG_MULTI_SZ: {
uint32 j;
- for (j = 0; j < valvalue->v.multi_sz.num_strings; j++) {
+ const char **a;
+
+ if (!pull_reg_multi_sz(talloc_tos(), &valvalue->data, &a)) {
+ break;
+ }
+ for (j = 0; a[j] != NULL; j++) {
if (!raw) {
d_printf(_("Value[%3.3d] = \""), j);
}
- d_printf("%s", valvalue->v.multi_sz.strings[j]);
+ d_printf("%s", a[j]);
if (!raw) {
d_printf("\"");
}
@@ -76,7 +92,7 @@ void print_registry_value(const struct registry_value *valvalue, bool raw)
if (!raw) {
d_printf(_("Value = "));
}
- d_printf(_("%d bytes\n"), (int)valvalue->v.binary.length);
+ d_printf(_("%d bytes\n"), (int)valvalue->data.length);
break;
default:
if (!raw) {