r10207: Add some const
authorJelmer Vernooij <jelmer@samba.org>
Tue, 13 Sep 2005 17:28:18 +0000 (17:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:38:08 +0000 (13:38 -0500)
(This used to be commit b1ad340b4720e922ae1e332c2a74986b1656358b)

source4/gtk/tools/gregedit.c
source4/lib/registry/common/reg_interface.c
source4/lib/registry/reg_backend_dir.c
source4/lib/registry/reg_backend_ldb.c
source4/lib/registry/reg_backend_nt4.c
source4/lib/registry/reg_backend_rpc.c
source4/lib/registry/reg_backend_w95.c
source4/lib/registry/regf.idl
source4/lib/registry/registry.h

index c574b5246b78839f3df3f35fcf2f8cb7ea2d7a2f..e00c33983e502da022e95d927c17614502cc0364 100644 (file)
@@ -433,15 +433,6 @@ static void on_open_remote_activate(GtkMenuItem *menuitem, gpointer user_data)
 }
 
 
-static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
-{
-       WERROR error = reg_save(registry, NULL);
-       if(!W_ERROR_IS_OK(error)) {
-               gtk_show_werror(mainwin, "Error while saving", error);
-       }
-}
-
-
 static void on_save_as_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
        gint result;
@@ -450,7 +441,7 @@ static void on_save_as_activate(GtkMenuItem *menuitem, gpointer user_data)
        result = gtk_dialog_run(GTK_DIALOG(savefilewin));
        switch(result) {
        case GTK_RESPONSE_OK:
-               error = reg_save(registry, gtk_file_selection_get_filename(GTK_FILE_SELECTION(savefilewin)));
+       /* FIXME:               error = reg_dump(registry, gtk_file_selection_get_filename(GTK_FILE_SELECTION(savefilewin))); */
                if(!W_ERROR_IS_OK(error)) {
                        gtk_show_werror(mainwin, "Error while saving as", error);
                }
@@ -886,9 +877,6 @@ static GtkWidget* create_mainwindow(void)
        gtk_box_pack_start (GTK_BOX (vbox1), statusbar, FALSE, FALSE, 0);
        gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), FALSE);
 
-       g_signal_connect ((gpointer) save, "activate",
-                                         G_CALLBACK (on_save_activate),
-                                         NULL);
        g_signal_connect ((gpointer) save_as, "activate",
                                          G_CALLBACK (on_save_as_activate),
                                          NULL);
index 74f158b02788cdca1163698d670de5c59ff70acb..7a35c97c439ee0218b219da03daef4c5a785f54d 100644 (file)
@@ -237,7 +237,7 @@ WERROR reg_open_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char
        return WERR_OK;
 }
 
-WERROR reg_key_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *key, int idx, struct registry_value **val)
+WERROR reg_key_get_value_by_index(TALLOC_CTX *mem_ctx, const struct registry_key *key, int idx, struct registry_value **val)
 {
        if(!key) return WERR_INVALID_PARAM;
 
@@ -252,7 +252,7 @@ WERROR reg_key_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *key,
        return WERR_OK;
 }
 
-WERROR reg_key_num_subkeys(struct registry_key *key, uint32_t *count)
+WERROR reg_key_num_subkeys(const struct registry_key *key, uint32_t *count)
 {
        if(!key) return WERR_INVALID_PARAM;
        
@@ -277,7 +277,7 @@ WERROR reg_key_num_subkeys(struct registry_key *key, uint32_t *count)
        return WERR_NOT_SUPPORTED;
 }
 
-WERROR reg_key_num_values(struct registry_key *key, uint32_t *count)
+WERROR reg_key_num_values(const struct registry_key *key, uint32_t *count)
 {
        
        if(!key) return WERR_INVALID_PARAM;
@@ -303,7 +303,7 @@ WERROR reg_key_num_values(struct registry_key *key, uint32_t *count)
        return WERR_NOT_SUPPORTED;
 }
 
-WERROR reg_key_get_subkey_by_index(TALLOC_CTX *mem_ctx, struct registry_key *key, int idx, struct registry_key **subkey)
+WERROR reg_key_get_subkey_by_index(TALLOC_CTX *mem_ctx, const struct registry_key *key, int idx, struct registry_key **subkey)
 {
        if(!key) return WERR_INVALID_PARAM;
 
@@ -323,7 +323,7 @@ WERROR reg_key_get_subkey_by_index(TALLOC_CTX *mem_ctx, struct registry_key *key
        return WERR_OK;;
 }
 
-WERROR reg_key_get_subkey_by_name(TALLOC_CTX *mem_ctx, struct registry_key *key, const char *name, struct registry_key **subkey)
+WERROR reg_key_get_subkey_by_name(TALLOC_CTX *mem_ctx, const struct registry_key *key, const char *name, struct registry_key **subkey)
 {
        int i;
        WERROR error = WERR_OK;
@@ -356,7 +356,7 @@ WERROR reg_key_get_subkey_by_name(TALLOC_CTX *mem_ctx, struct registry_key *key,
        return WERR_OK; 
 }
 
-WERROR reg_key_get_value_by_name(TALLOC_CTX *mem_ctx, struct registry_key *key, const char *name, struct registry_value **val)
+WERROR reg_key_get_value_by_name(TALLOC_CTX *mem_ctx, const struct registry_key *key, const char *name, struct registry_value **val)
 {
        int i;
        WERROR error = WERR_OK;
@@ -395,7 +395,7 @@ WERROR reg_key_del(struct registry_key *parent, const char *name)
        return WERR_OK;
 }
 
-WERROR reg_key_add_name(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *desc, struct registry_key **newkey)
+WERROR reg_key_add_name(TALLOC_CTX *mem_ctx, const struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *desc, struct registry_key **newkey)
 {
        WERROR error;
        
@@ -432,7 +432,7 @@ WERROR reg_val_set(struct registry_key *key, const char *value, uint32_t type, D
 }
 
 
-WERROR reg_get_sec_desc(TALLOC_CTX *ctx, struct registry_key *key, struct security_descriptor **secdesc)
+WERROR reg_get_sec_desc(TALLOC_CTX *ctx, const struct registry_key *key, struct security_descriptor **secdesc)
 {
        /* A 'real' set function has preference */
        if (key->hive->functions->key_get_sec_desc) 
@@ -442,7 +442,7 @@ WERROR reg_get_sec_desc(TALLOC_CTX *ctx, struct registry_key *key, struct securi
        return WERR_NOT_SUPPORTED;
 }
 
-WERROR reg_del_value(struct registry_key *key, const char *valname)
+WERROR reg_del_value(const struct registry_key *key, const char *valname)
 {
        WERROR ret = WERR_OK;
        if(!key->hive->functions->del_value)
@@ -455,12 +455,7 @@ WERROR reg_del_value(struct registry_key *key, const char *valname)
        return ret;
 }
 
-WERROR reg_save (struct registry_context *ctx, const char *location)
-{
-       return WERR_NOT_SUPPORTED;
-}
-
-WERROR reg_key_flush(struct registry_key *key)
+WERROR reg_key_flush(const struct registry_key *key)
 {
        if (!key) {
                return WERR_INVALID_PARAM;
@@ -474,7 +469,7 @@ WERROR reg_key_flush(struct registry_key *key)
        return WERR_OK;
 }
 
-WERROR reg_key_subkeysizes(struct registry_key *key, uint32_t *max_subkeylen, uint32_t *max_subkeysize)
+WERROR reg_key_subkeysizes(const struct registry_key *key, uint32_t *max_subkeylen, uint32_t *max_subkeysize)
 {
        int i = 0; 
        struct registry_key *subkey;
@@ -499,7 +494,7 @@ WERROR reg_key_subkeysizes(struct registry_key *key, uint32_t *max_subkeylen, ui
        return WERR_OK;
 }
 
-WERROR reg_key_valuesizes(struct registry_key *key, uint32_t *max_valnamelen, uint32_t *max_valbufsize)
+WERROR reg_key_valuesizes(const struct registry_key *key, uint32_t *max_valnamelen, uint32_t *max_valbufsize)
 {
        int i = 0; 
        struct registry_value *value;
index 68f02d17459fb9c501ec8b6f415a1ea98f5b72cc..da22d8d9eee2df6f88b872cbc937fc192f21c3a0 100644 (file)
@@ -23,7 +23,7 @@
 #include "system/dir.h"
 #include "system/filesys.h"
 
-static WERROR reg_dir_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *desc, struct registry_key **result)
+static WERROR reg_dir_add_key(TALLOC_CTX *mem_ctx, const struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *desc, struct registry_key **result)
 {
        char *path;
        int ret;
@@ -35,7 +35,7 @@ static WERROR reg_dir_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent,
        return WERR_INVALID_PARAM;
 }
 
-static WERROR reg_dir_del_key(struct registry_key *k, const char *name)
+static WERROR reg_dir_del_key(const struct registry_key *k, const char *name)
 {
        char *child = talloc_asprintf(NULL, "%s/%s", (char *)k->backend_data, name);
        WERROR ret;
@@ -47,7 +47,7 @@ static WERROR reg_dir_del_key(struct registry_key *k, const char *name)
        return ret;
 }
 
-static WERROR reg_dir_open_key(TALLOC_CTX *mem_ctx, struct registry_key *p, const char *name, struct registry_key **subkey)
+static WERROR reg_dir_open_key(TALLOC_CTX *mem_ctx, const struct registry_key *p, const char *name, struct registry_key **subkey)
 {
        DIR *d;
        char *fullpath, *unixpath;
@@ -76,7 +76,7 @@ static WERROR reg_dir_open_key(TALLOC_CTX *mem_ctx, struct registry_key *p, cons
        return WERR_OK;
 }
 
-static WERROR reg_dir_key_by_index(TALLOC_CTX *mem_ctx, struct registry_key *k, int idx, struct registry_key **key)
+static WERROR reg_dir_key_by_index(TALLOC_CTX *mem_ctx, const struct registry_key *k, int idx, struct registry_key **key)
 {
        struct dirent *e;
        char *fullpath = k->backend_data;
index f51c02a286e37ecf4fc122a576d5a4b972ed2143..469961dfb48c059305964a507cf450ed44bfbdfd 100644 (file)
@@ -112,7 +112,7 @@ static int reg_close_ldb_key (void *data)
        return 0;
 }
 
-static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx, struct registry_key *from, const char *path, const char *add)
+static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx, const struct registry_key *from, const char *path, const char *add)
 {
        TALLOC_CTX *local_ctx;
        struct ldb_dn *ret = ldb_dn_new(mem_ctx);
@@ -153,7 +153,7 @@ static struct ldb_dn *reg_path_to_ldb(TALLOC_CTX *mem_ctx, struct registry_key *
 }
 
 
-static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, int idx, struct registry_key **subkey)
+static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, const struct registry_key *k, int idx, struct registry_key **subkey)
 {
        struct ldb_context *c = k->hive->backend_data;
        struct ldb_message_element *el;
@@ -184,7 +184,7 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k,
        return WERR_OK;
 }
 
-static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, int idx, struct registry_value **value)
+static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, const struct registry_key *k, int idx, struct registry_value **value)
 {
        struct ldb_context *c = k->hive->backend_data;
        struct ldb_key_data *kd = k->backend_data;
@@ -208,7 +208,7 @@ static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, i
        return WERR_OK;
 }
 
-static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const char *name, struct registry_key **key)
+static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct registry_key *h, const char *name, struct registry_key **key)
 {
        struct ldb_context *c = h->hive->backend_data;
        struct ldb_message **msg;
@@ -265,7 +265,7 @@ static WERROR ldb_open_hive(struct registry_hive *hive, struct registry_key **k)
        return WERR_OK;
 }
 
-static WERROR ldb_add_key (TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *sd, struct registry_key **newkey)
+static WERROR ldb_add_key (TALLOC_CTX *mem_ctx, const struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *sd, struct registry_key **newkey)
 {
        struct ldb_context *ctx = parent->hive->backend_data;
        struct ldb_message *msg;
@@ -293,7 +293,7 @@ static WERROR ldb_add_key (TALLOC_CTX *mem_ctx, struct registry_key *parent, con
        return WERR_OK;
 }
 
-static WERROR ldb_del_key (struct registry_key *key, const char *child)
+static WERROR ldb_del_key (const struct registry_key *key, const char *child)
 {
        int ret;
        struct ldb_key_data *kd = key->backend_data;
@@ -312,7 +312,7 @@ static WERROR ldb_del_key (struct registry_key *key, const char *child)
        return WERR_OK;
 }
 
-static WERROR ldb_del_value (struct registry_key *key, const char *child)
+static WERROR ldb_del_value (const struct registry_key *key, const char *child)
 {
        int ret;
        struct ldb_key_data *kd = key->backend_data;
@@ -331,7 +331,7 @@ static WERROR ldb_del_value (struct registry_key *key, const char *child)
        return WERR_OK;
 }
 
-static WERROR ldb_set_value (struct registry_key *parent, const char *name, uint32_t type, DATA_BLOB data)
+static WERROR ldb_set_value (const struct registry_key *parent, const char *name, uint32_t type, DATA_BLOB data)
 {
        struct ldb_context *ctx = parent->hive->backend_data;
        struct ldb_message *msg;
index e5c022150440105122da83170baa3bf134a09b05..4d33f481e6090c344e7733791a1df6250e1161a3 100644 (file)
@@ -367,7 +367,7 @@ static uint32_t hbin_store_tdr_resize (struct regf_data *regf, tdr_push_fn_t pus
        return ret;
 }
 
-static WERROR regf_num_subkeys (struct registry_key *key, uint32_t *count)
+static WERROR regf_num_subkeys (const struct registry_key *key, uint32_t *count)
 {
        struct nk_block *nk = key->backend_data;
 
@@ -376,7 +376,7 @@ static WERROR regf_num_subkeys (struct registry_key *key, uint32_t *count)
        return WERR_OK;
 }
 
-static WERROR regf_num_values (struct registry_key *key, uint32_t *count)
+static WERROR regf_num_values (const struct registry_key *key, uint32_t *count)
 {
        struct nk_block *nk = key->backend_data;
 
@@ -415,7 +415,7 @@ static struct registry_key *regf_get_key (TALLOC_CTX *ctx, struct regf_data *reg
        return ret;
 }
 
-static WERROR regf_get_value (TALLOC_CTX *ctx, struct registry_key *key, int idx, struct registry_value **ret)
+static WERROR regf_get_value (TALLOC_CTX *ctx, const struct registry_key *key, int idx, struct registry_value **ret)
 {
        struct nk_block *nk = key->backend_data;
        struct vk_block *vk;
@@ -468,7 +468,7 @@ static WERROR regf_get_value (TALLOC_CTX *ctx, struct registry_key *key, int idx
        return WERR_OK;
 }
 
-static WERROR regf_get_subkey (TALLOC_CTX *ctx, struct registry_key *key, int idx, struct registry_key **ret)
+static WERROR regf_get_subkey (TALLOC_CTX *ctx, const struct registry_key *key, int idx, struct registry_key **ret)
 {
        DATA_BLOB data;
        struct nk_block *nk = key->backend_data;
@@ -522,13 +522,13 @@ static WERROR regf_get_subkey (TALLOC_CTX *ctx, struct registry_key *key, int id
 }
 
 
-static WERROR regf_set_sec_desc (struct registry_key *key, struct security_descriptor *sec_desc)
+static WERROR regf_set_sec_desc (const struct registry_key *key, const struct security_descriptor *sec_desc)
 {
        /* FIXME */
        return WERR_NOT_SUPPORTED;
 }
 
-static WERROR regf_get_sec_desc(TALLOC_CTX *ctx, struct registry_key *key, struct security_descriptor **sd)
+static WERROR regf_get_sec_desc(TALLOC_CTX *ctx, const struct registry_key *key, struct security_descriptor **sd)
 {
        struct nk_block *nk = key->backend_data;
        struct sk_block sk;
@@ -588,14 +588,14 @@ static uint32_t lf_add_entry (struct regf_data *regf, uint32_t list_offset, cons
        return ret;
 }
 
-static WERROR regf_del_value (struct registry_key *parent, const char *name)
+static WERROR regf_del_value (const struct registry_key *parent, const char *name)
 {
        /* FIXME */
        return WERR_NOT_SUPPORTED;
 }
 
 
-static WERROR regf_del_key (struct registry_key *parent, const char *name)
+static WERROR regf_del_key (const struct registry_key *parent, const char *name)
 {
        struct nk_block *nk = parent->backend_data;
 
@@ -609,7 +609,7 @@ static WERROR regf_del_key (struct registry_key *parent, const char *name)
        return WERR_NOT_SUPPORTED;
 }
 
-static WERROR regf_add_key (TALLOC_CTX *ctx, struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *sec_desc, struct registry_key **ret)
+static WERROR regf_add_key (TALLOC_CTX *ctx, const struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *sec_desc, struct registry_key **ret)
 {
        struct nk_block *parent_nk = parent->backend_data, nk;
        struct regf_data *regf = parent->hive->backend_data;
@@ -645,7 +645,7 @@ static WERROR regf_add_key (TALLOC_CTX *ctx, struct registry_key *parent, const
        return WERR_OK;
 }
 
-static WERROR regf_set_value (struct registry_key *key, const char *name, uint32_t type, DATA_BLOB data)
+static WERROR regf_set_value (const struct registry_key *key, const char *name, uint32_t type, const DATA_BLOB data)
 {
        /* FIXME */
 
index a00accc6be337c1632c1da5d8299a1b01c98fec0..1e9fff4d7c296f777dd51781dc0ec371f756139c 100644 (file)
@@ -81,7 +81,7 @@ static struct {
 { 0, NULL }
 };
 
-static WERROR rpc_query_key(struct registry_key *k);
+static WERROR rpc_query_key(const struct registry_key *k);
 
 static WERROR rpc_get_predefined_key (struct registry_context *ctx, uint32_t hkey_type, struct registry_key **k)
 {
@@ -137,7 +137,7 @@ static WERROR rpc_key_put_rpc_data(TALLOC_CTX *mem_ctx, struct registry_key *k)
 }
 #endif
 
-static WERROR rpc_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const char *name, struct registry_key **key)
+static WERROR rpc_open_key(TALLOC_CTX *mem_ctx, const struct registry_key *h, const char *name, struct registry_key **key)
 {
        struct rpc_key_data *mykeydata;
     struct winreg_OpenKey r;
@@ -163,7 +163,7 @@ static WERROR rpc_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const ch
        return r.out.result;
 }
 
-static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *parent, int n, struct registry_value **value)  
+static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, const struct registry_key *parent, int n, struct registry_value **value)  
 {
        struct rpc_key_data *mykeydata = parent->backend_data;
        WERROR error;
@@ -211,7 +211,7 @@ static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *p
        return r.out.result;
 }
 
-static WERROR rpc_get_subkey_by_index(TALLOC_CTX *mem_ctx, struct registry_key *parent, int n, struct registry_key **subkey) 
+static WERROR rpc_get_subkey_by_index(TALLOC_CTX *mem_ctx, const struct registry_key *parent, int n, struct registry_key **subkey) 
 {
        struct winreg_EnumKey r;
        struct rpc_key_data *mykeydata = parent->backend_data;
@@ -242,7 +242,7 @@ static WERROR rpc_get_subkey_by_index(TALLOC_CTX *mem_ctx, struct registry_key *
        return r.out.result;
 }
 
-static WERROR rpc_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *sec, struct registry_key **key)
+static WERROR rpc_add_key(TALLOC_CTX *mem_ctx, const struct registry_key *parent, const char *name, uint32_t access_mask, struct security_descriptor *sec, struct registry_key **key)
 {
        NTSTATUS status;
        struct winreg_CreateKey r;
@@ -272,7 +272,7 @@ static WERROR rpc_add_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, cons
        return r.out.result;
 }
 
-static WERROR rpc_query_key(struct registry_key *k)
+static WERROR rpc_query_key(const struct registry_key *k)
 {
     NTSTATUS status;
     struct winreg_QueryInfoKey r;
@@ -300,7 +300,7 @@ static WERROR rpc_query_key(struct registry_key *k)
        return r.out.result;
 }
 
-static WERROR rpc_del_key(struct registry_key *parent, const char *name)
+static WERROR rpc_del_key(const struct registry_key *parent, const char *name)
 {
        NTSTATUS status;
        struct rpc_key_data *mykeydata = parent->backend_data;
@@ -317,7 +317,7 @@ static WERROR rpc_del_key(struct registry_key *parent, const char *name)
        return r.out.result;
 }
 
-static WERROR rpc_num_values(struct registry_key *key, uint32_t *count) 
+static WERROR rpc_num_values(const struct registry_key *key, uint32_t *count) 
 {
        struct rpc_key_data *mykeydata = key->backend_data;
        WERROR error;
@@ -331,7 +331,7 @@ static WERROR rpc_num_values(struct registry_key *key, uint32_t *count)
        return WERR_OK;
 }
 
-static WERROR rpc_num_subkeys(struct registry_key *key, uint32_t *count) 
+static WERROR rpc_num_subkeys(const struct registry_key *key, uint32_t *count) 
 {
        struct rpc_key_data *mykeydata = key->backend_data;
        WERROR error;
index 03460052da29afea9b14b6355dc5fb5716accddb..d5ce0e33f867b25f6fe02f30227b0cf0f1ce64b7 100644 (file)
@@ -267,7 +267,7 @@ static WERROR w95_open_reg (struct registry_hive *h, struct registry_key **root)
        return WERR_OK;
 }
 
-static WERROR w95_get_subkey_by_index (TALLOC_CTX *mem_ctx, struct registry_key *parent, int n, struct registry_key **key)
+static WERROR w95_get_subkey_by_index (TALLOC_CTX *mem_ctx, const struct registry_key *parent, int n, struct registry_key **key)
 {
        CREG *creg = parent->hive->backend_data;
        RGKN_KEY *rgkn_key = parent->backend_data;
@@ -303,7 +303,7 @@ static WERROR w95_get_subkey_by_index (TALLOC_CTX *mem_ctx, struct registry_key
        return WERR_NO_MORE_ITEMS;
 }
 
-static WERROR w95_num_values(struct registry_key *k, uint32_t *count)
+static WERROR w95_num_values(const struct registry_key *k, uint32_t *count)
 {
        RGKN_KEY *rgkn_key = k->backend_data;
        RGDB_KEY *rgdb_key = LOCN_RGDB_KEY((CREG *)k->hive->backend_data, rgkn_key->id.rgdb, rgkn_key->id.id);
@@ -315,7 +315,7 @@ static WERROR w95_num_values(struct registry_key *k, uint32_t *count)
        return WERR_OK;
 }
 
-static WERROR w95_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, int idx, struct registry_value **value)
+static WERROR w95_get_value_by_id(TALLOC_CTX *mem_ctx, const struct registry_key *k, int idx, struct registry_value **value)
 {
        RGKN_KEY *rgkn_key = k->backend_data;
        DWORD i;
index 85a879cc36e53cb9b71ee14b88864f788c5e8829..dcb1df039bd9065693829ed4a6c4e00595b5d1f7 100644 (file)
@@ -51,7 +51,7 @@ interface regf
        } regf_hdr;
 
        /* 
-               hbin probably means hive-bin (what bin stands for I don't know)
+               hbin probably means hive-bin (i.e. hive-container)
                This block is always a multiple
                of 4kb in size.
      */
index e843e1a0bece5d8c106a7fc30d13cb388232f934..69f360673688b0fb24d061893118b88cc9daf61d 100644 (file)
 #define REGISTRY_INTERFACE_VERSION 1
 
 /* structure to store the registry handles */
-struct registry_key {
-  char *name;         /* Name of the key                    */
-  const char *path;              /* Full path to the key */
-  char *class_name; /* Name of key class */
-  NTTIME last_mod; /* Time last modified                 */
+struct registry_key 
+{
+  char *name;       
+  const char *path;    
+  char *class_name; 
+  NTTIME last_mod; 
   struct registry_hive *hive;
   void *backend_data;
 };
 
-struct registry_value {
+struct registry_value 
+{
   char *name;
   unsigned int data_type;
   DATA_BLOB data;
 };
 
 /* FIXME */
-typedef void (*key_notification_function) (void);
-typedef void (*value_notification_function) (void);
+typedef void (*reg_key_notification_function) (void);
+typedef void (*reg_value_notification_function) (void);
 
 /* 
  * Container for function pointers to enumeration routines
@@ -85,38 +87,39 @@ struct hive_operations {
        WERROR (*open_hive) (struct registry_hive *, struct registry_key **);
 
        /* Or this one */
-       WERROR (*open_key) (TALLOC_CTX *, struct registry_key *, const char *name, struct registry_key **);
+       WERROR (*open_key) (TALLOC_CTX *, const struct registry_key *, const char *name, struct registry_key **);
 
-       WERROR (*num_subkeys) (struct registry_key *, uint32_t *count);
-       WERROR (*num_values) (struct registry_key *, uint32_t *count);
-       WERROR (*get_subkey_by_index) (TALLOC_CTX *, struct registry_key *, int idx, struct registry_key **);
+       WERROR (*num_subkeys) (const struct registry_key *, uint32_t *count);
+       WERROR (*num_values) (const struct registry_key *, uint32_t *count);
+       WERROR (*get_subkey_by_index) (TALLOC_CTX *, const struct registry_key *, int idx, struct registry_key **);
 
        /* Can not contain more then one level */
-       WERROR (*get_subkey_by_name) (TALLOC_CTX *, struct registry_key *, const char *name, struct registry_key **);
-       WERROR (*get_value_by_index) (TALLOC_CTX *, struct registry_key *, int idx, struct registry_value **);
+       WERROR (*get_subkey_by_name) (TALLOC_CTX *, const struct registry_key *, const char *name, struct registry_key **);
+       WERROR (*get_value_by_index) (TALLOC_CTX *, const struct registry_key *, int idx, struct registry_value **);
 
        /* Can not contain more then one level */
-       WERROR (*get_value_by_name) (TALLOC_CTX *, struct registry_key *, const char *name, struct registry_value **);
+       WERROR (*get_value_by_name) (TALLOC_CTX *, const struct registry_key *, const char *name, struct registry_value **);
 
        /* Security control */
-       WERROR (*key_get_sec_desc) (TALLOC_CTX *, struct registry_key *, struct security_descriptor **);
-       WERROR (*key_set_sec_desc) (struct registry_key *, struct security_descriptor *);
+       WERROR (*key_get_sec_desc) (TALLOC_CTX *, const struct registry_key *, struct security_descriptor **);
+       WERROR (*key_set_sec_desc) (const struct registry_key *, const struct security_descriptor *);
 
        /* Notification */
-       WERROR (*request_key_change_notify) (struct registry_key *, key_notification_function);
-       WERROR (*request_value_change_notify) (struct registry_value *, value_notification_function);
+       WERROR (*request_key_change_notify) (const struct registry_key *, reg_key_notification_function);
+       WERROR (*request_value_change_notify) (const struct registry_value *, reg_value_notification_function);
 
        /* Key management */
-       WERROR (*add_key)(TALLOC_CTX *, struct registry_key *, const char *name, uint32_t access_mask, struct security_descriptor *, struct registry_key **);
-       WERROR (*del_key)(struct registry_key *, const char *name);
-       WERROR (*flush_key) (struct registry_key *);
+       WERROR (*add_key)(TALLOC_CTX *, const struct registry_key *, const char *name, uint32_t access_mask, struct security_descriptor *, struct registry_key **);
+       WERROR (*del_key)(const struct registry_key *, const char *name);
+       WERROR (*flush_key) (const struct registry_key *);
 
        /* Value management */
-       WERROR (*set_value)(struct registry_key *, const char *name, uint32_t type, DATA_BLOB data); 
-       WERROR (*del_value)(struct registry_key *, const char *valname);
+       WERROR (*set_value)(const struct registry_key *, const char *name, uint32_t type, const DATA_BLOB data); 
+       WERROR (*del_value)(const struct registry_key *, const char *valname);
 };
 
-struct registry_hive {
+struct registry_hive
+{
        const struct hive_operations *functions;
        struct registry_key *root;
        void *backend_data;