summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-04-11 16:04:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:13 -0500
commit07afafd45df34c4617c9e3e31bcd3130a9e255e3 (patch)
tree3f96edfaabd2248f7a7318c72ecee0dbfddd7fd0 /source4
parent6df152f96495e68426a52bf62be2c44900b7e8cf (diff)
downloadsamba-07afafd45df34c4617c9e3e31bcd3130a9e255e3.tar.gz
samba-07afafd45df34c4617c9e3e31bcd3130a9e255e3.tar.bz2
samba-07afafd45df34c4617c9e3e31bcd3130a9e255e3.zip
r165: Add support for viewing registry values in gregedit
(This used to be commit 1d8a6d762aa4dab54bb58959cb1e7957a76e5b6e)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/TODO3
-rw-r--r--source4/lib/registry/tools/gregedit.c63
-rw-r--r--source4/librpc/idl/winreg.idl4
-rw-r--r--source4/torture/rpc/winreg.c6
4 files changed, 48 insertions, 28 deletions
diff --git a/source4/lib/registry/TODO b/source4/lib/registry/TODO
index fc741cea40..f84b1c5339 100644
--- a/source4/lib/registry/TODO
+++ b/source4/lib/registry/TODO
@@ -19,6 +19,9 @@ reg_backend_ldb:
reg_backend_wine.c:
- finish
+regshell:
+ - support for security descriptors
+
gregedit.c:
- support for editing values / adding values / deleting values
- support for adding/deleting keys
diff --git a/source4/lib/registry/tools/gregedit.c b/source4/lib/registry/tools/gregedit.c
index 2d145e699a..51fad4287d 100644
--- a/source4/lib/registry/tools/gregedit.c
+++ b/source4/lib/registry/tools/gregedit.c
@@ -63,23 +63,6 @@ static void gtk_show_werror(WERROR err)
gtk_widget_destroy (dialog);
}
-static void treeview_add_val(REG_VAL *val)
-{
- GtkTreeIter iter;
- gtk_list_store_append(store_vals, &iter);
- gtk_list_store_set (store_vals,
- &iter,
- 0,
- reg_val_name(val),
- 1,
- str_regtype(reg_val_type(val)),
- 2,
- reg_val_data_string(val),
- 3,
- val,
- -1);
-}
-
static void expand_key(GtkTreeView *treeview, GtkTreeIter *parent, GtkTreePath *arg2)
{
GtkTreeIter iter, tmpiter;
@@ -394,18 +377,32 @@ void on_key_activate (GtkTreeView *treeview,
REG_KEY *k;
REG_VAL *val;
WERROR error;
+ GtkTreeIter parent;
-//FIXME gtk_tree_model_get(GTK_TREE_MODEL(store_keys), iter, 1, &k, -1);
+ gtk_tree_model_get_iter(GTK_TREE_MODEL(store_keys), &parent, path);
+ gtk_tree_model_get(GTK_TREE_MODEL(store_keys), &parent, 1, &k, -1);
+
+ g_assert(k);
gtk_list_store_clear(store_vals);
for(i = 0; W_ERROR_IS_OK(error = reg_key_get_value_by_index(k, i, &val)); i++) {
- treeview_add_val(val);
+ GtkTreeIter iter;
+ gtk_list_store_append(store_vals, &iter);
+ gtk_list_store_set (store_vals,
+ &iter,
+ 0,
+ reg_val_name(val),
+ 1,
+ str_regtype(reg_val_type(val)),
+ 2,
+ reg_val_data_string(val),
+ 3,
+ val,
+ -1);
}
if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) gtk_show_werror(error);
-
- return;
}
GtkWidget* create_mainwin (void)
@@ -567,15 +564,29 @@ GtkWidget* create_mainwin (void)
tree_vals = gtk_tree_view_new ();
/* Column names */
- curcol = gtk_tree_view_column_new_with_attributes ("Name", gtk_cell_renderer_text_new(), NULL);
+
+ curcol = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title(curcol, "Name");
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(curcol, renderer, True);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree_vals), curcol);
+ gtk_tree_view_column_add_attribute(curcol, renderer, "text", 0);
-
- curcol = gtk_tree_view_column_new_with_attributes ("Type", gtk_cell_renderer_text_new(), NULL);
+ curcol = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title(curcol, "Type");
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(curcol, renderer, True);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree_vals), curcol);
-
- curcol = gtk_tree_view_column_new_with_attributes ("Value", gtk_cell_renderer_text_new(), NULL);
+ gtk_tree_view_column_add_attribute(curcol, renderer, "text", 1);
+
+ curcol = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title(curcol, "Value");
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(curcol, renderer, True);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree_vals), curcol);
+ gtk_tree_view_column_add_attribute(curcol, renderer, "text", 2);
+
+
gtk_widget_show (tree_vals);
gtk_container_add (GTK_CONTAINER (scrolledwindow2), tree_vals);
diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl
index 39e46c0761..539889b515 100644
--- a/source4/librpc/idl/winreg.idl
+++ b/source4/librpc/idl/winreg.idl
@@ -247,9 +247,11 @@
/******************/
/* Function: 0x18 */
WERROR winreg_InitiateSystemShutdown(
+ [in] winreg_String hostname,
[in] winreg_String message,
[in] uint32 timeout,
- [in] uint16 flags
+ [in] uint16 flags,
+ [out] uint16 status
);
/******************/
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 68466f0084..42326b1468 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -407,8 +407,9 @@ static BOOL test_AbortSystemShutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
struct winreg_AbortSystemShutdown r;
NTSTATUS status;
+ uint16 server = 0x0;
- r.in.server = 0x0;
+ r.in.server = &server;
status = dcerpc_winreg_AbortSystemShutdown(p, mem_ctx, &r);
@@ -557,6 +558,9 @@ BOOL torture_rpc_winreg(int dummy)
if(!test_InitiateSystemShutdown(p, mem_ctx, "spottyfood", 30))
ret = False;
+ if(!test_AbortSystemShutdown(p, mem_ctx))
+ ret = False;
+
for (i = 0; i < ARRAY_SIZE(open_fns); i++) {
if (!test_Open(p, mem_ctx, open_fns[i]))
ret = False;