summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_reg.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-29 16:24:11 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-29 16:24:11 +0000
commit3d096e1b8f5a253b61cbfa6155b0a16a5394c847 (patch)
tree14d6ab4f91467f5f9ff10f82dc7d18f36ee938d5 /source3/rpc_client/cli_reg.c
parent97993e4973333b504abd2de7a23b1a554841d547 (diff)
downloadsamba-3d096e1b8f5a253b61cbfa6155b0a16a5394c847.tar.gz
samba-3d096e1b8f5a253b61cbfa6155b0a16a5394c847.tar.bz2
samba-3d096e1b8f5a253b61cbfa6155b0a16a5394c847.zip
added HKEY_CLASSES_ROOT MSRPC open call. reg_open_hkcr etc. supported
in rpcclient, regenum HKEY_CLASSES_ROOT or regenum HKCR to test. (This used to be commit b0aa933ef4c0b58840430cf3b3cb3cbeb5c7f704)
Diffstat (limited to 'source3/rpc_client/cli_reg.c')
-rw-r--r--source3/rpc_client/cli_reg.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index cbbd6e57bf..49423beaa5 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -59,6 +59,14 @@ BOOL do_reg_connect(struct cli_state *cli, uint16 fnum, char *full_keyname, char
switch (reg_type)
{
+ case HKEY_CLASSES_ROOT:
+ {
+ res = res ? do_reg_open_hkcr(cli, fnum,
+ 0x5428, 0x02000000,
+ reg_hnd) : False;
+ break;
+ }
+
case HKEY_LOCAL_MACHINE:
{
res = res ? do_reg_open_hklm(cli, fnum,
@@ -87,6 +95,63 @@ BOOL do_reg_connect(struct cli_state *cli, uint16 fnum, char *full_keyname, char
/****************************************************************************
do a REG Open Policy
****************************************************************************/
+BOOL do_reg_open_hkcr(struct cli_state *cli, uint16 fnum, uint16 unknown_0, uint32 level,
+ POLICY_HND *hnd)
+{
+ prs_struct rbuf;
+ prs_struct buf;
+ REG_Q_OPEN_HKCR q_o;
+ BOOL valid_pol = 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_OPEN_HKCR */
+
+ DEBUG(4,("REG Open HKCR\n"));
+
+ make_reg_q_open_hkcr(&q_o, unknown_0, level);
+
+ /* turn parameters into data stream */
+ reg_io_q_open_hkcr("", &q_o, &buf, 0);
+
+ /* send the data on \PIPE\ */
+ if (rpc_api_pipe_req(cli, fnum, REG_OPEN_HKCR, &buf, &rbuf))
+ {
+ REG_R_OPEN_HKCR r_o;
+ BOOL p;
+
+ ZERO_STRUCT(r_o);
+
+ reg_io_r_open_hkcr("", &r_o, &rbuf, 0);
+ p = rbuf.offset != 0;
+
+ if (p && r_o.status != 0)
+ {
+ /* report error code */
+ DEBUG(0,("REG_OPEN_HKCR: %s\n", get_nt_error_msg(r_o.status)));
+ p = False;
+ }
+
+ if (p)
+ {
+ /* ok, at last: we're happy. return the policy handle */
+ memcpy(hnd, r_o.pol.data, sizeof(hnd->data));
+ valid_pol = True;
+ }
+ }
+
+ prs_mem_free(&rbuf);
+ prs_mem_free(&buf );
+
+ return valid_pol;
+}
+
+/****************************************************************************
+do a REG Open Policy
+****************************************************************************/
BOOL do_reg_open_hklm(struct cli_state *cli, uint16 fnum, uint16 unknown_0, uint32 level,
POLICY_HND *hnd)
{