summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/registry/reg_objects.c18
-rw-r--r--source3/registry/reg_objects.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c
index 6336d00657..baa3000eb6 100644
--- a/source3/registry/reg_objects.c
+++ b/source3/registry/reg_objects.c
@@ -407,6 +407,24 @@ bool regval_ctr_value_exists(struct regval_ctr *ctr, const char *value)
return False;
}
+/**
+ * Get a value by its name
+ */
+struct regval_blob *regval_ctr_value_byname(struct regval_ctr *ctr,
+ const char *value)
+{
+ int i;
+
+ for (i = 0; i < ctr->num_values; i++) {
+ if (strequal(ctr->values[i]->valuename, value)) {
+ return ctr->values[i];
+ }
+ }
+
+ return NULL;
+}
+
+
/***********************************************************************
* compose a struct regval_blob from input data
**********************************************************************/
diff --git a/source3/registry/reg_objects.h b/source3/registry/reg_objects.h
index 52d078e678..9e1c1d1795 100644
--- a/source3/registry/reg_objects.h
+++ b/source3/registry/reg_objects.h
@@ -53,6 +53,8 @@ char* regval_name(struct regval_blob *val);
uint32_t regval_type(struct regval_blob *val);
struct regval_blob* regval_ctr_specific_value(struct regval_ctr *ctr,
uint32_t idx);
+struct regval_blob *regval_ctr_value_byname(struct regval_ctr *ctr,
+ const char *value);
bool regval_ctr_value_exists(struct regval_ctr *ctr, const char *value);
struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
uint32_t type,