From 47fa1d33e4a6b9aeaf06ad2c12d9744bdf967bb9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 13 Dec 2004 00:45:29 +0000 Subject: r4166: More small API fixes, keep registry structs as small as possible. Implement DelValue in the RPC server (This used to be commit f6b9ec89af934e837069fb26c0e3491fc78ebc12) --- source4/lib/registry/tools/regpatch.c | 6 +----- source4/lib/registry/tools/regshell.c | 8 +------- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'source4/lib/registry/tools') diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index a4a4649c96..18589a9285 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -701,13 +701,9 @@ static int nt_apply_reg_command_file(struct registry_context *r, const char *cmd while (cmd->val_count) { VAL_SPEC_LIST *val = cmd->val_spec_list; - struct registry_value *reg_val = NULL; if (val->type == REG_DELETE) { - error = reg_key_get_value_by_name( mem_ctx, tmp, val->name, ®_val); - if(W_ERROR_IS_OK(error)) { - error = reg_del_value(reg_val); - } + error = reg_del_value(tmp, val->name); if(!W_ERROR_IS_OK(error)) { DEBUG(0, ("Error removing value '%s'\n", val->name)); } diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 47d84c1f62..0a09708869 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -142,18 +142,12 @@ static struct registry_key *cmd_rmkey(TALLOC_CTX *mem_ctx, struct registry_key * static struct registry_key *cmd_rmval(TALLOC_CTX *mem_ctx, struct registry_key *cur, int argc, char **argv) { - struct registry_value *val; if(argc < 2) { fprintf(stderr, "Usage: rmval \n"); return NULL; } - if(!W_ERROR_IS_OK(reg_key_get_value_by_name(mem_ctx, cur, argv[1], &val))) { - fprintf(stderr, "No such value '%s'\n", argv[1]); - return NULL; - } - - if(!W_ERROR_IS_OK(reg_del_value(val))) { + if(!W_ERROR_IS_OK(reg_del_value(cur, argv[1]))) { fprintf(stderr, "Error deleting value '%s'\n", argv[1]); } else { fprintf(stderr, "Successfully deleted value '%s'\n", argv[1]); -- cgit