summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-02-24 22:43:47 +0100
committerMichael Adam <obnox@samba.org>2009-02-26 13:22:51 +0100
commit763f41f39c2b3c3488992297bc1c0e1ab785ad07 (patch)
treee291decd8ae7267d2573d0556f119b1d6ad20d61 /source3
parent060abd7e38bff8cecf5821e9a9878f18c04a7a1d (diff)
downloadsamba-763f41f39c2b3c3488992297bc1c0e1ab785ad07.tar.gz
samba-763f41f39c2b3c3488992297bc1c0e1ab785ad07.tar.bz2
samba-763f41f39c2b3c3488992297bc1c0e1ab785ad07.zip
s3:registry: add a regsubkey_ctr_init function for allocating a regsubkey_ctr
Michael
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/registry/reg_objects.c16
2 files changed, 16 insertions, 1 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8947e762e7..dd4fa7b4aa 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5129,6 +5129,7 @@ WERROR registry_init_smbconf(const char *keyname);
/* The following definitions come from registry/reg_objects.c */
+WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr);
WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
int regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c
index 15f9879706..10ad41e84b 100644
--- a/source3/registry/reg_objects.c
+++ b/source3/registry/reg_objects.c
@@ -30,12 +30,26 @@
talloc()'d since the methods use the object pointer as the talloc
context for internal private data.
- There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy()
+ There is no longer a regval_ctr_intit() and regval_ctr_destroy()
pair of functions. Simply TALLOC_ZERO_P() and TALLOC_FREE() the
object.
**********************************************************************/
+WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr)
+{
+ if (ctr == NULL) {
+ return WERR_INVALID_PARAM;
+ }
+
+ *ctr = talloc_zero(mem_ctx, struct regsubkey_ctr);
+ if (*ctr == NULL) {
+ return WERR_NOMEM;
+ }
+
+ return WERR_OK;
+}
+
/***********************************************************************
Add a new key to the array
**********************************************************************/