diff options
Diffstat (limited to 'source3/registry/reg_backend_db.c')
-rw-r--r-- | source3/registry/reg_backend_db.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 84ac57216b..e5386f7d91 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -50,6 +50,7 @@ static bool regdb_store_values_internal(struct db_context *db, const char *key, struct regval_ctr *values); static NTSTATUS create_sorted_subkeys(const char *key); +static WERROR regdb_create_basekey(struct db_context *db, const char *key); /* List the deepest path into the registry. All part components will be created.*/ @@ -1188,6 +1189,41 @@ static WERROR regdb_create_subkey(const char *key, const char *subkey) } /** + * create a base key + */ + +struct regdb_create_basekey_context { + const char *key; +}; + +static NTSTATUS regdb_create_basekey_action(struct db_context *db, + void *private_data) +{ + WERROR werr; + struct regdb_create_basekey_context *create_ctx; + + create_ctx = (struct regdb_create_basekey_context *)private_data; + + werr = regdb_store_subkey_list(db, NULL, create_ctx->key); + + return werror_to_ntstatus(werr); +} + +static WERROR regdb_create_basekey(struct db_context *db, const char *key) +{ + WERROR werr; + struct regdb_create_subkey_context create_ctx; + + create_ctx.key = key; + + werr = ntstatus_to_werror(dbwrap_trans_do(db, + regdb_create_basekey_action, + &create_ctx)); + + return werr; +} + +/** * create a subkey of a given key */ |