s3:registry: add a regsubkey_ctr_init function for allocating a regsubkey_ctr
authorMichael Adam <obnox@samba.org>
Tue, 24 Feb 2009 21:43:47 +0000 (22:43 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 26 Feb 2009 12:24:07 +0000 (13:24 +0100)
Michael

source/registry/reg_objects.c

index 15f98797067bdfd8d040cf3eca6312ac4fbfc342..10ad41e84b3c7313628df7f69ae1dd692d817450 100644 (file)
  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
  **********************************************************************/