summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-23 22:47:53 +0200
committerMichael Adam <obnox@samba.org>2010-05-25 10:35:28 +0200
commite0d5bccfd381ebb83ee7d626ee94087d47f4b8dd (patch)
tree524cf9a514d432f22f4bb003e2eafa28f47dfd68
parent97846edfa59b95572d176981bb4bab6a5c06b61c (diff)
downloadsamba-e0d5bccfd381ebb83ee7d626ee94087d47f4b8dd.tar.gz
samba-e0d5bccfd381ebb83ee7d626ee94087d47f4b8dd.tar.bz2
samba-e0d5bccfd381ebb83ee7d626ee94087d47f4b8dd.zip
s3:registry:reg_objects: add regval_ctr_init()
-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 ?
**********************************************************************/