summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-13 17:28:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:08 -0500
commit5d2c2edc19d471cb2b757c53eeb007f4dd7f9348 (patch)
tree1c9ce50855160f7dc9fc2cf9da509fe870d1c96c /source4
parent45f760973d9b5c0663608e779eb337c0648e9313 (diff)
downloadsamba-5d2c2edc19d471cb2b757c53eeb007f4dd7f9348.tar.gz
samba-5d2c2edc19d471cb2b757c53eeb007f4dd7f9348.tar.bz2
samba-5d2c2edc19d471cb2b757c53eeb007f4dd7f9348.zip
r10207: Add some const
(This used to be commit b1ad340b4720e922ae1e332c2a74986b1656358b)
Diffstat (limited to 'source4')
-rw-r--r--source4/gtk/tools/gregedit.c14
-rw-r--r--source4/lib/registry/common/reg_interface.c29
-rw-r--r--source4/lib/registry/reg_backend_dir.c8
-rw-r--r--source4/lib/registry/reg_backend_ldb.c16
-rw-r--r--source4/lib/registry/reg_backend_nt4.c20
-rw-r--r--source4/lib/registry/reg_backend_rpc.c18
-rw-r--r--source4/lib/registry/reg_backend_w95.c6
-rw-r--r--source4/lib/registry/regf.idl2
-rw-r--r--source4/lib/registry/registry.h53
9 files changed, 76 insertions, 90 deletions
diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c
index c574b5246b..e00c33983e 100644
--- a/source4/gtk/tools/gregedit.c
+++ b/source4/gtk/tools/gregedit.c
@@ -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);
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c
index 74f158b027..7a35c97c43 100644
--- a/source4/lib/registry/common/reg_interface.c
+++ b/source4/lib/registry/common/reg_interface.c
@@ -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;
diff --git a/source4/lib/registry/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir.c
index 68f02d1745..da22d8d9ee 100644
--- a/source4/lib/registry/reg_backend_dir.c
+++ b/source4/lib/registry/reg_backend_dir.c
@@ -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;
diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c
index f51c02a286..469961dfb4 100644
--- a/source4/lib/registry/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb.c
@@ -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;
diff --git a/source4/lib/registry/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4.c
index e5c0221504..4d33f481e6 100644
--- a/source4/lib/registry/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4.c
@@ -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 */
diff --git a/source4/lib/registry/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc.c
index a00accc6be..1e9fff4d7c 100644
--- a/source4/lib/registry/reg_backend_rpc.c
+++ b/source4/lib/registry/reg_backend_rpc.c
@@ -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;
diff --git a/source4/lib/registry/reg_backend_w95.c b/source4/lib/registry/reg_backend_w95.c
index 03460052da..d5ce0e33f8 100644
--- a/source4/lib/registry/reg_backend_w95.c
+++ b/source4/lib/registry/reg_backend_w95.c
@@ -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;
diff --git a/source4/lib/registry/regf.idl b/source4/lib/registry/regf.idl
index 85a879cc36..dcb1df039b 100644
--- a/source4/lib/registry/regf.idl
+++ b/source4/lib/registry/regf.idl
@@ -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.
*/
diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h
index e843e1a0be..69f3606736 100644
--- a/source4/lib/registry/registry.h
+++ b/source4/lib/registry/registry.h
@@ -43,24 +43,26 @@
#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;