summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/reg_objects.h1
-rw-r--r--source3/registry/reg_objects.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h
index 770eed64c2..0cfb25d1f6 100644
--- a/source3/include/reg_objects.h
+++ b/source3/include/reg_objects.h
@@ -173,6 +173,7 @@ WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr );
char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index );
+WERROR regval_ctr_init(TALLOC_CTX *mem_ctx, struct regval_ctr **ctr);
int regval_ctr_numvals(struct regval_ctr *ctr);
struct regval_blob* dup_registry_value(struct regval_blob *val);
void free_registry_value(struct regval_blob *val);
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c
index 52f2b6bbf1..148fdee7f2 100644
--- a/source3/registry/reg_objects.c
+++ b/source3/registry/reg_objects.c
@@ -293,6 +293,23 @@ char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32_t key_index
* Utility functions for struct regval_ctr
*/
+/**
+ * allocate a regval_ctr structure.
+ */
+WERROR regval_ctr_init(TALLOC_CTX *mem_ctx, struct regval_ctr **ctr)
+{
+ if (ctr == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
+ *ctr = talloc_zero(mem_ctx, struct regval_ctr);
+ if (*ctr == NULL) {
+ return WERR_NOMEM;
+ }
+
+ return WERR_OK;
+}
+
/***********************************************************************
How many keys does the container hold ?
**********************************************************************/