r7645: adding server stubs for RegCreateKey() and RegSetValue()
authorGerald Carter <jerry@samba.org>
Thu, 16 Jun 2005 20:04:16 +0000 (20:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:57:18 +0000 (10:57 -0500)
(This used to be commit ce82566badfb907a2f72e2f7d90a7bbbe3811177)

source3/include/rpc_reg.h
source3/rpc_client/cli_reg.c
source3/rpc_parse/parse_reg.c
source3/rpc_server/srv_reg.c
source3/rpc_server/srv_reg_nt.c

index 59684a5b5e91c1ef5a7bc45621f9d40619d5bd9a..83b44ce7c996e7f49c5fbad1754e80590db20d57 100644 (file)
@@ -215,7 +215,7 @@ typedef struct {
 /***********************************************/
 
 typedef struct {
-       POLICY_HND pnt_pol;
+       POLICY_HND handle;
        UNISTR4 name;
        UNISTR4 class;
        uint32 reserved;
@@ -237,7 +237,7 @@ typedef struct {
 /***********************************************/
 
 typedef struct {
-       POLICY_HND pnt_pol;
+       POLICY_HND handle;
        UNISTR4 name;
 } REG_Q_DELETE_KEY;
 
@@ -249,7 +249,7 @@ typedef struct {
 /***********************************************/
 
 typedef struct {
-       POLICY_HND pnt_pol;
+       POLICY_HND handle;
        UNISTR4 name;
 } REG_Q_DELETE_VALUE;
 
index 74866e4b8e0f24a5b6de29a2c4ffb81672e8d9a3..d152aeecf1f9ba43bdcbbfcd4db44cdadbb84992 100644 (file)
@@ -539,8 +539,8 @@ WERROR cli_reg_set_val(struct cli_state *cli, TALLOC_CTX *mem_ctx,
        CLI_DO_RPC( cli, mem_ctx, PI_WINREG, REG_SET_VALUE, 
                    in, out, 
                    qbuf, rbuf,
-                   reg_io_q_set_val,
-                   reg_io_r_set_val, 
+                   reg_io_q_set_value,
+                   reg_io_r_set_value
                    WERR_GENERAL_FAILURE );
 
        return out.status;
index 7e8ae030397961d02bdbb3d5f467126197c9cdcd..7957478af08a23c969a57eb12b6f8fc6e8de8286 100644 (file)
@@ -212,7 +212,7 @@ void init_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd,
 {
        ZERO_STRUCTP(q_c);
 
-       memcpy(&q_c->pnt_pol, hnd, sizeof(q_c->pnt_pol));
+       memcpy(&q_c->handle, hnd, sizeof(q_c->handle));
 
 
        init_unistr4( &q_c->name, name, UNI_STR_TERMINATE );
@@ -246,7 +246,7 @@ BOOL reg_io_q_create_key(const char *desc,  REG_Q_CREATE_KEY *q_u,
        if(!prs_align(ps))
                return False;
        
-       if(!smb_io_pol_hnd("", &q_u->pnt_pol, ps, depth))
+       if(!smb_io_pol_hnd("", &q_u->handle, ps, depth))
                return False;
 
        if(!prs_unistr4 ("name", ps, depth, &q_u->name))
@@ -318,7 +318,7 @@ void init_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd,
 {
        ZERO_STRUCTP(q_c);
 
-       memcpy(&q_c->pnt_pol, hnd, sizeof(q_c->pnt_pol));
+       memcpy(&q_c->handle, hnd, sizeof(q_c->handle));
        init_unistr4(&q_c->name, name, UNI_STR_TERMINATE);
 }
 
@@ -338,7 +338,7 @@ BOOL reg_io_q_delete_val(const char *desc, REG_Q_DELETE_VALUE *q_u,
        if(!prs_align(ps))
                return False;
        
-       if(!smb_io_pol_hnd("", &q_u->pnt_pol, ps, depth))
+       if(!smb_io_pol_hnd("", &q_u->handle, ps, depth))
                return False;
 
        if(!prs_unistr4("name", ps, depth, &q_u->name))
@@ -381,7 +381,7 @@ void init_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd,
 {
        ZERO_STRUCTP(q_c);
 
-       memcpy(&q_c->pnt_pol, hnd, sizeof(q_c->pnt_pol));
+       memcpy(&q_c->handle, hnd, sizeof(q_c->handle));
 
        init_unistr4(&q_c->name, name, UNI_STR_TERMINATE);
 }
@@ -402,7 +402,7 @@ BOOL reg_io_q_delete_key(const char *desc,  REG_Q_DELETE_KEY *q_u,
        if(!prs_align(ps))
                return False;
        
-       if(!smb_io_pol_hnd("", &q_u->pnt_pol, ps, depth))
+       if(!smb_io_pol_hnd("", &q_u->handle, ps, depth))
                return False;
 
        if(!prs_unistr4("", ps, depth, &q_u->name))
@@ -1232,7 +1232,7 @@ void init_reg_q_set_val(REG_Q_SET_VALUE *q_u, POLICY_HND *pol,
 reads or writes a structure.
 ********************************************************************/
 
-BOOL reg_io_q_set_val(const char *desc,  REG_Q_SET_VALUE *q_u, prs_struct *ps, int depth)
+BOOL reg_io_q_set_value(const char *desc,  REG_Q_SET_VALUE *q_u, prs_struct *ps, int depth)
 {
        if (q_u == NULL)
                return False;
@@ -1269,7 +1269,7 @@ BOOL reg_io_q_set_val(const char *desc,  REG_Q_SET_VALUE *q_u, prs_struct *ps, i
 reads or writes a structure.
 ********************************************************************/
 
-BOOL reg_io_r_set_val(const char *desc,  REG_R_SET_VALUE *q_u, prs_struct *ps, int depth)
+BOOL reg_io_r_set_value(const char *desc,  REG_R_SET_VALUE *q_u, prs_struct *ps, int depth)
 {
        if ( !q_u )
                return False;
index a90650c536d950e6b9dfa8277621130e6853d739..8c703f3a5a3efa405fbbda2bc8923f660da62e43 100644 (file)
@@ -416,6 +416,54 @@ static BOOL api_reg_save_key(pipes_struct *p)
        return True;
 }
 
+/*******************************************************************
+ ******************************************************************/
+
+static BOOL api_reg_create_key(pipes_struct *p)
+{
+       REG_Q_CREATE_KEY q_u;
+       REG_R_CREATE_KEY r_u;
+       prs_struct *data = &p->in_data.data;
+       prs_struct *rdata = &p->out_data.rdata;
+
+       ZERO_STRUCT(q_u);
+       ZERO_STRUCT(r_u);
+
+       if(!reg_io_q_create_key("", &q_u, data, 0))
+               return False;
+               
+       r_u.status = _reg_create_key(p, &q_u, &r_u);
+
+       if(!reg_io_r_create_key("", &r_u, rdata, 0))
+               return False;
+
+       return True;
+}
+
+/*******************************************************************
+ ******************************************************************/
+
+static BOOL api_reg_set_value(pipes_struct *p)
+{
+       REG_Q_SET_VALUE q_u;
+       REG_R_SET_VALUE r_u;
+       prs_struct *data = &p->in_data.data;
+       prs_struct *rdata = &p->out_data.rdata;
+
+       ZERO_STRUCT(q_u);
+       ZERO_STRUCT(r_u);
+
+       if(!reg_io_q_set_value("", &q_u, data, 0))
+               return False;
+               
+       r_u.status = _reg_set_value(p, &q_u, &r_u);
+
+       if(!reg_io_r_set_value("", &r_u, rdata, 0))
+               return False;
+
+       return True;
+}
+
 /*******************************************************************
  array of \PIPE\reg operations
  ********************************************************************/
@@ -436,7 +484,9 @@ static struct api_struct api_reg_cmds[] =
       { "REG_ABORT_SHUTDOWN"     , REG_ABORT_SHUTDOWN     , api_reg_abort_shutdown   },
       { "REG_GETVERSION"         , REG_GETVERSION         , api_reg_getversion       },
       { "REG_SAVE_KEY"           , REG_SAVE_KEY           , api_reg_save_key         },
-      { "REG_RESTORE_KEY"        , REG_RESTORE_KEY        , api_reg_restore_key      }
+      { "REG_RESTORE_KEY"        , REG_RESTORE_KEY        , api_reg_restore_key      },
+      { "REG_CREATE_KEY"         , REG_CREATE_KEY         , api_reg_create_key       },
+      { "REG_SET_VALUE"          , REG_SET_VALUE          , api_reg_set_value        }
 };
 
 void reg_get_pipe_fns( struct api_struct **fns, int *n_fns )
index 9df8e9b5fc8b27985ced36341615d5149a489668..31a6c019bb0bcf8438101ee6018c823a87ff10db 100644 (file)
@@ -1071,4 +1071,20 @@ WERROR _reg_save_key(pipes_struct *p, REG_Q_SAVE_KEY  *q_u, REG_R_SAVE_KEY *r_u)
        return WERR_OK;
 }
 
+/*******************************************************************
+ ********************************************************************/
+
+WERROR _reg_create_key(pipes_struct *p, REG_Q_CREATE_KEY  *q_u, REG_R_CREATE_KEY *r_u)
+{
+       return WERR_ACCESS_DENIED;
+}
+
+
+/*******************************************************************
+ ********************************************************************/
+
+WERROR _reg_set_value(pipes_struct *p, REG_Q_SET_VALUE  *q_u, REG_R_SET_VALUE *r_u)
+{
+       return WERR_ACCESS_DENIED;
+}