mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
r24418: Adding reg_deleteallvalues().
Guenther
This commit is contained in:
parent
56bab5ea4c
commit
f7457c6173
@ -618,6 +618,30 @@ WERROR reg_deletevalue(struct registry_key *key, const char *name)
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
WERROR reg_deleteallvalues(struct registry_key *key)
|
||||
{
|
||||
WERROR err;
|
||||
int i;
|
||||
|
||||
if (!(key->key->access_granted & SEC_RIGHTS_SET_VALUE)) {
|
||||
return WERR_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (!W_ERROR_IS_OK(err = fill_value_cache(key))) {
|
||||
return err;
|
||||
}
|
||||
|
||||
for (i=0; i<key->values->num_values; i++) {
|
||||
regval_ctr_delvalue(key->values, key->values->values[i]->valuename);
|
||||
}
|
||||
|
||||
if (!store_reg_values(key->key, key->values)) {
|
||||
TALLOC_FREE(key->values);
|
||||
return WERR_REG_IO_FAILURE;
|
||||
}
|
||||
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Utility function to open a complete registry path including the hive
|
||||
|
Loading…
x
Reference in New Issue
Block a user