mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
s3:registry: add function regsubkey_ctr_reinit()
This reinitializes an already allocated regsubkey_ctr structure, emptying out the subkey array and hash table. Michael
This commit is contained in:
parent
dc0bcfa188
commit
92df5e4a02
@ -5097,6 +5097,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_reinit(struct regsubkey_ctr *ctr);
|
||||
WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum);
|
||||
int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr);
|
||||
WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
|
||||
|
@ -63,6 +63,29 @@ WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr)
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* re-initialize the list of subkeys (to the emtpy list)
|
||||
* in an already allocated regsubkey_ctr
|
||||
*/
|
||||
|
||||
WERROR regsubkey_ctr_reinit(struct regsubkey_ctr *ctr)
|
||||
{
|
||||
if (ctr == NULL) {
|
||||
return WERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
talloc_free(ctr->subkeys_hash);
|
||||
ctr->subkeys_hash = db_open_rbt(ctr);
|
||||
W_ERROR_HAVE_NO_MEMORY(ctr->subkeys_hash);
|
||||
|
||||
TALLOC_FREE(ctr->subkeys);
|
||||
|
||||
ctr->num_subkeys = 0;
|
||||
ctr->seqnum = 0;
|
||||
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum)
|
||||
{
|
||||
if (ctr == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user