const char *path; /* Full path to the key */
char *class_name; /* Name of key class */
NTTIME last_mod; /* Time last modified */
- SEC_DESC *security;
struct registry_hive *hive;
void *backend_data;
- int ref;
};
struct registry_value {
unsigned int data_type;
int data_len;
void *data_blk; /* Might want a separate block */
- struct registry_hive *hive;
- struct registry_key *parent;
- void *backend_data;
- int ref;
};
/* FIXME */
/* Value management */
WERROR (*set_value)(struct registry_key *, const char *name, int type, void *data, int len);
- WERROR (*del_value)(struct registry_value *);
+ WERROR (*del_value)(struct registry_key *, const char *valname);
};
struct registry_hive {
return WERR_NOT_SUPPORTED;
}
- (*val)->parent = key;
- (*val)->hive = key->hive;
return WERR_OK;
}
if(!W_ERROR_IS_OK(error) && !W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS))
return error;
- (*val)->parent = key;
- (*val)->hive = key->hive;
-
return WERR_OK;
}
}
if(W_ERROR_IS_OK(error)) {
- error = reg_del_value(val);
+ error = reg_del_value(key, val->name);
if(!W_ERROR_IS_OK(error)) {
talloc_destroy(mem_ctx);
return error;
-WERROR reg_del_value(struct registry_value *val)
+WERROR reg_del_value(struct registry_key *key, const char *valname)
{
WERROR ret = WERR_OK;
- if(!val->hive->functions->del_value)
+ if(!key->hive->functions->del_value)
return WERR_NOT_SUPPORTED;
- ret = val->hive->functions->del_value(val);
+ ret = key->hive->functions->del_value(key, valname);
if(!W_ERROR_IS_OK(ret)) return ret;
return WERR_OK;
}
-static WERROR reg_dir_set_value(struct registry_key *p, const char *name, int type, void *data, int len)
-{
- /* FIXME */
- return WERR_NOT_SUPPORTED;
-}
-
-static WERROR reg_dir_del_value(struct registry_value *v)
-{
- /* FIXME*/
- return WERR_NOT_SUPPORTED;
-}
-
static struct hive_operations reg_backend_dir = {
.name = "dir",
.open_hive = reg_dir_open,
.open_key = reg_dir_open_key,
.add_key = reg_dir_add_key,
.del_key = reg_dir_del_key,
- .get_subkey_by_index = reg_dir_key_by_index,
- .set_value = reg_dir_set_value,
- .del_value = reg_dir_del_value,
+ .get_subkey_by_index = reg_dir_key_by_index
};
NTSTATUS registry_dir_init(void)
*value = talloc_p(mem_ctx, struct registry_value);
(*value)->name = talloc_strdup(mem_ctx, el->values[0].data);
- (*value)->backend_data = talloc_strdup(mem_ctx, kd->values[idx]->dn);
+ /* FIXME */
return WERR_OK;
}
if(NT_STATUS_IS_OK(status) &&
W_ERROR_IS_OK(r.out.result) && r.out.length) {
*value = talloc_p(mem_ctx, struct registry_value);
- (*value)->parent = parent;
(*value)->name = talloc_strdup(mem_ctx, r.out.name_out.name);
(*value)->data_type = type;
(*value)->data_len = *r.out.length;
}
*value = talloc_p(mem_ctx, struct registry_value);
- (*value)->backend_data = curval;
(*value)->name = talloc_strndup(mem_ctx, (char *)curval+sizeof(RGDB_VALUE), curval->name_len);
(*value)->data_len = curval->data_len;
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));
}
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 <valuename>\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]);
struct winreg_DeleteValue *r)
{
struct dcesrv_handle *h;
- struct registry_value *value;
+ struct registry_key *key;
- h = dcesrv_handle_fetch(dce_call->conn, r->in.handle, HTYPE_REGVAL);
+ h = dcesrv_handle_fetch(dce_call->conn, r->in.handle, HTYPE_REGKEY);
DCESRV_CHECK_HANDLE(h);
- value = h->data;
+ key = h->data;
- /* FIXME */
-
- return WERR_NOT_SUPPORTED;
+ return reg_del_value(key, r->in.value.name);
}