summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/registry/reg_api_util.c8
-rw-r--r--source3/registry/reg_api_util.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/source3/registry/reg_api_util.c b/source3/registry/reg_api_util.c
index 42aaa00c61..e86e3e3fc3 100644
--- a/source3/registry/reg_api_util.c
+++ b/source3/registry/reg_api_util.c
@@ -237,3 +237,11 @@ struct registry_value *registry_value_multi_sz(TALLOC_CTX *mem_ctx, const char *
return ret;
}
+
+int registry_value_cmp(const struct registry_value* v1, const struct registry_value* v2)
+{
+ if (v1->type == v2->type) {
+ return data_blob_cmp(&v1->data, &v2->data);
+ }
+ return v1->type - v2->type;
+}
diff --git a/source3/registry/reg_api_util.h b/source3/registry/reg_api_util.h
index 7009794beb..b5ce0fdbe4 100644
--- a/source3/registry/reg_api_util.h
+++ b/source3/registry/reg_api_util.h
@@ -44,4 +44,6 @@ struct registry_value *registry_value_dw(TALLOC_CTX *mem_ctx, uint32_t dw);
struct registry_value *registry_value_sz(TALLOC_CTX *mem_ctx, const char *str);
struct registry_value *registry_value_multi_sz(TALLOC_CTX *mem_ctx, const char **str);
+int registry_value_cmp(const struct registry_value *v1, const struct registry_value *v2);
+
#endif /* _REG_API_UTIL_H */