summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-11-10 22:14:05 +0000
committerLuke Leighton <lkcl@samba.org>1998-11-10 22:14:05 +0000
commit75ca9df787b4fe51032bca71f228fd8526e81fdf (patch)
tree00f6f5adee14f701170ecee6132c850c4caf5db3 /source3/rpc_client
parentc098e44df44e3c6ace3ce00d28140329821e8f3d (diff)
downloadsamba-75ca9df787b4fe51032bca71f228fd8526e81fdf.tar.gz
samba-75ca9df787b4fe51032bca71f228fd8526e81fdf.tar.bz2
samba-75ca9df787b4fe51032bca71f228fd8526e81fdf.zip
rpcclient registry key delete command: "regdeletekey".
(This used to be commit 20987b6105d42f3404ff009cc27e73a1823cd495)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_reg.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index 459a865fc0..3acd8281de 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -451,6 +451,60 @@ BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd,
}
/****************************************************************************
+do a REG Delete Key
+****************************************************************************/
+BOOL do_reg_delete_key(struct cli_state *cli, POLICY_HND *hnd, char *key_name)
+{
+ prs_struct rbuf;
+ prs_struct buf;
+ REG_Q_DELETE_KEY q_o;
+ BOOL valid_delete = False;
+
+ if (hnd == NULL) return False;
+
+ prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
+ prs_init(&rbuf, 0 , 4, SAFETY_MARGIN, True );
+
+ /* create and send a MSRPC command with api REG_DELETE_KEY */
+
+ DEBUG(4,("REG Delete Key: %s\n", key_name));
+
+ make_reg_q_delete_key(&q_o, hnd, key_name);
+
+ /* turn parameters into data stream */
+ reg_io_q_delete_key("", &q_o, &buf, 0);
+
+ /* send the data on \PIPE\ */
+ if (rpc_api_pipe_req(cli, REG_DELETE_KEY, &buf, &rbuf))
+ {
+ REG_R_DELETE_KEY r_o;
+ BOOL p;
+
+ ZERO_STRUCT(r_o);
+
+ reg_io_r_delete_key("", &r_o, &rbuf, 0);
+ p = rbuf.offset != 0;
+
+ if (p && r_o.status != 0)
+ {
+ /* report error code */
+ DEBUG(0,("REG_DELETE_KEY: %s\n", get_nt_error_msg(r_o.status)));
+ p = False;
+ }
+
+ if (p)
+ {
+ valid_delete = True;
+ }
+ }
+
+ prs_mem_free(&rbuf);
+ prs_mem_free(&buf );
+
+ return valid_delete;
+}
+
+/****************************************************************************
do a REG Create Key
****************************************************************************/
BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,