From eced96cf26b08b1fd606381eeced5abec9fac3c4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 26 Feb 2009 02:54:50 +0100 Subject: [PATCH] s3:registry: add a delete_subkey method to the backend ops. This is to provide a more atomic means of deleting a subkey of a key. Michael Signed-off-by: Michael Adam --- source/include/proto.h | 1 + source/include/reg_objects.h | 1 + source/registry/reg_dispatcher.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/source/include/proto.h b/source/include/proto.h index b75ab76ef97..c2b318ee0db 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -6768,6 +6768,7 @@ void reghook_dump_cache( int debuglevel ); bool store_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkeys ); bool store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val ); WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey); +WERROR delete_reg_subkey(REGISTRY_KEY *key, const char *subkey); int fetch_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkey_ctr ); int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val ); bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted, diff --git a/source/include/reg_objects.h b/source/include/reg_objects.h index 29cd4c563d9..a03ac1bff46 100644 --- a/source/include/reg_objects.h +++ b/source/include/reg_objects.h @@ -132,6 +132,7 @@ typedef struct { int (*fetch_values) ( const char *key, REGVAL_CTR *val ); bool (*store_subkeys)( const char *key, struct regsubkey_ctr *subkeys ); WERROR (*create_subkey)(const char *key, const char *subkey); + WERROR (*delete_subkey)(const char *key, const char *subkey); bool (*store_values)( const char *key, REGVAL_CTR *val ); bool (*reg_access_check)( const char *keyname, uint32 requested, uint32 *granted, diff --git a/source/registry/reg_dispatcher.c b/source/registry/reg_dispatcher.c index 555e821bf1a..106d38e9a53 100644 --- a/source/registry/reg_dispatcher.c +++ b/source/registry/reg_dispatcher.c @@ -109,6 +109,15 @@ WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey) return WERR_NOT_SUPPORTED; } +WERROR delete_reg_subkey(REGISTRY_KEY *key, const char *subkey) +{ + if (key->ops && key->ops->delete_subkey) { + return key->ops->delete_subkey(key->name, subkey); + } + + return WERR_NOT_SUPPORTED; +} + /*********************************************************************** High level wrapper function for enumerating registry subkeys Initialize the TALLOC_CTX if necessary -- 2.11.4.GIT