summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_dfs.c184
-rw-r--r--source3/rpc_server/srv_lsa.c44
-rw-r--r--source3/rpc_server/srv_pipe.c12
-rw-r--r--source3/rpc_server/srv_reg.c20
-rw-r--r--source3/rpc_server/srv_samr.c122
-rw-r--r--source3/rpc_server/srv_srvsvc.c39
-rw-r--r--source3/rpc_server/srv_wkssvc.c8
7 files changed, 259 insertions, 170 deletions
diff --git a/source3/rpc_server/srv_dfs.c b/source3/rpc_server/srv_dfs.c
index 2a8bb71604..62acbaa6cc 100644
--- a/source3/rpc_server/srv_dfs.c
+++ b/source3/rpc_server/srv_dfs.c
@@ -1,4 +1,3 @@
-
/*
* Unix SMB/Netbios implementation.
* Version 1.9.
@@ -35,17 +34,18 @@ extern pstring global_myname;
/**********************************************************************
api_dfs_exist
**********************************************************************/
-static BOOL api_dfs_exist( prs_struct *data,
- prs_struct *rdata)
+static BOOL api_dfs_exist(pipes_struct *p)
{
- DFS_R_DFS_EXIST r_d;
-
- if(lp_host_msdfs())
- r_d.dfs_exist_flag = 1;
- else
- r_d.dfs_exist_flag = 0;
-
- return dfs_io_r_dfs_exist("", &r_d, rdata, 0);
+ DFS_R_DFS_EXIST r_d;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ if(lp_host_msdfs())
+ r_d.dfs_exist_flag = 1;
+ else
+ r_d.dfs_exist_flag = 0;
+
+ return dfs_io_r_dfs_exist("", &r_d, rdata, 0);
}
static uint32 init_reply_dfs_add(DFS_Q_DFS_ADD* q_a)
@@ -109,19 +109,21 @@ static uint32 init_reply_dfs_add(DFS_Q_DFS_ADD* q_a)
/*****************************************************************
api_dfs_add
*****************************************************************/
-static BOOL api_dfs_add(prs_struct* data, prs_struct* rdata)
+static BOOL api_dfs_add(pipes-struct *p)
{
- DFS_Q_DFS_ADD q_a;
- DFS_R_DFS_ADD r_a;
-
- if(!dfs_io_q_dfs_add("", &q_a, data, 0))
- return False;
-
- r_a.status = init_reply_dfs_add(&q_a);
-
- dfs_io_r_dfs_add("", &r_a, rdata, 0);
-
- return True;
+ DFS_Q_DFS_ADD q_a;
+ DFS_R_DFS_ADD r_a;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ if(!dfs_io_q_dfs_add("", &q_a, data, 0))
+ return False;
+
+ r_a.status = init_reply_dfs_add(&q_a);
+
+ dfs_io_r_dfs_add("", &r_a, rdata, 0);
+
+ return True;
}
static uint32 init_reply_dfs_remove(DFS_Q_DFS_REMOVE* q_r)
@@ -198,19 +200,19 @@ static uint32 init_reply_dfs_remove(DFS_Q_DFS_REMOVE* q_r)
/*****************************************************************
api_dfs_remove
*****************************************************************/
-static BOOL api_dfs_remove(prs_struct* data, prs_struct* rdata)
+static BOOL api_dfs_remove(pipes_struct *p)
{
- DFS_Q_DFS_REMOVE q_r;
- DFS_R_DFS_REMOVE r_r;
-
- if(!dfs_io_q_dfs_remove("", &q_r, data, 0))
- return False;
-
- r_r.status = init_reply_dfs_remove(&q_r);
-
- dfs_io_r_dfs_remove("", &r_r, rdata, 0);
-
- return True;
+ DFS_Q_DFS_REMOVE q_r;
+ DFS_R_DFS_REMOVE r_r;
+
+ if(!dfs_io_q_dfs_remove("", &q_r, data, 0))
+ return False;
+
+ r_r.status = init_reply_dfs_remove(&q_r);
+
+ dfs_io_r_dfs_remove("", &r_r, rdata, 0);
+
+ return True;
}
static BOOL init_reply_dfs_info_1(struct junction_map* j, DFS_INFO_1* dfs1, int num_j)
@@ -377,59 +379,63 @@ static uint32 init_reply_dfs_get_info(UNISTR2* uni_path, uint32 level,
/*******************************************************************
api_dfs_get_info
*******************************************************************/
-static BOOL api_dfs_get_info(prs_struct* data, prs_struct* rdata)
+static BOOL api_dfs_get_info(pipes_struct *p)
{
- DFS_Q_DFS_GET_INFO q_i;
- DFS_R_DFS_GET_INFO r_i;
-
- ZERO_STRUCT(r_i);
-
- if(!dfs_io_q_dfs_get_info("", &q_i, data, 0))
- return False;
-
- r_i.status = init_reply_dfs_get_info(&q_i.uni_path, q_i.level, &r_i);
-
- if(!dfs_io_r_dfs_get_info("", &r_i, rdata, 0))
- return False;
-
- switch(r_i.level) {
- case 1: free(r_i.ctr.dfs.info1); break;
- case 2: free(r_i.ctr.dfs.info2); break;
- case 3:
- {
- free(r_i.ctr.dfs.info3->storages);
- free(r_i.ctr.dfs.info3);
- break;
- }
- }
- return True;
+ DFS_Q_DFS_GET_INFO q_i;
+ DFS_R_DFS_GET_INFO r_i;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ ZERO_STRUCT(r_i);
+
+ if(!dfs_io_q_dfs_get_info("", &q_i, data, 0))
+ return False;
+
+ r_i.status = init_reply_dfs_get_info(&q_i.uni_path, q_i.level, &r_i);
+
+ if(!dfs_io_r_dfs_get_info("", &r_i, rdata, 0))
+ return False;
+
+ switch(r_i.level) {
+ case 1: free(r_i.ctr.dfs.info1); break;
+ case 2: free(r_i.ctr.dfs.info2); break;
+ case 3: {
+ free(r_i.ctr.dfs.info3->storages);
+ free(r_i.ctr.dfs.info3);
+ break;
+ }
+ }
+ return True;
}
/*******************************************************************
api_dfs_enum
*******************************************************************/
-static BOOL api_dfs_enum(prs_struct* data, prs_struct* rdata)
+static BOOL api_dfs_enum(pipes_struct *p)
{
- DFS_Q_DFS_ENUM q_e;
- DFS_R_DFS_ENUM q_r;
-
- if(!dfs_io_q_dfs_enum("", &q_e, data, 0))
- return False;
-
- q_r.status = init_reply_dfs_enum(q_e.level, &q_r);
-
- if(!dfs_io_r_dfs_enum("", &q_r, rdata, 0))
- return False;
- switch(q_e.level) {
- case 1:
- free(q_r.ctr->dfs.info1); break;
- case 2:
- free(q_r.ctr->dfs.info2); break;
- case 3:
- free(q_r.ctr->dfs.info3->storages); free(q_r.ctr->dfs.info3); break;
- }
- free(q_r.ctr);
- return True;
+ DFS_Q_DFS_ENUM q_e;
+ DFS_R_DFS_ENUM q_r;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ if(!dfs_io_q_dfs_enum("", &q_e, data, 0))
+ return False;
+
+ q_r.status = init_reply_dfs_enum(q_e.level, &q_r);
+
+ if(!dfs_io_r_dfs_enum("", &q_r, rdata, 0))
+ return False;
+ switch(q_e.level) {
+ case 1:
+ free(q_r.ctr->dfs.info1); break;
+ case 2:
+ free(q_r.ctr->dfs.info2); break;
+ case 3:
+ free(q_r.ctr->dfs.info3->storages);
+ free(q_r.ctr->dfs.info3); break;
+ }
+ free(q_r.ctr);
+ return True;
}
/*******************************************************************
@@ -437,20 +443,20 @@ static BOOL api_dfs_enum(prs_struct* data, prs_struct* rdata)
********************************************************************/
struct api_struct api_netdfs_cmds[] =
{
- {"DFS_EXIST", DFS_EXIST, api_dfs_exist },
- {"DFS_ADD", DFS_ADD, api_dfs_add },
- {"DFS_REMOVE", DFS_REMOVE, api_dfs_remove },
- {"DFS_GET_INFO", DFS_GET_INFO, api_dfs_get_info },
- {"DFS_ENUM", DFS_ENUM, api_dfs_enum },
- {NULL, 0, NULL }
+ {"DFS_EXIST", DFS_EXIST, api_dfs_exist },
+ {"DFS_ADD", DFS_ADD, api_dfs_add },
+ {"DFS_REMOVE", DFS_REMOVE, api_dfs_remove },
+ {"DFS_GET_INFO", DFS_GET_INFO, api_dfs_get_info },
+ {"DFS_ENUM", DFS_ENUM, api_dfs_enum },
+ {NULL, 0, NULL }
};
/*******************************************************************
receives a netdfs pipe and responds.
********************************************************************/
-BOOL api_netdfs_rpc(pipes_struct *p, prs_struct *data)
+BOOL api_netdfs_rpc(pipes_struct *p)
{
- return api_rpcTNP(p, "api_netdfs_rpc", api_netdfs_cmds, data);
+ return api_rpcTNP(p, "api_netdfs_rpc", api_netdfs_cmds);
}
#endif
diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c
index f132e4b39b..7df7686878 100644
--- a/source3/rpc_server/srv_lsa.c
+++ b/source3/rpc_server/srv_lsa.c
@@ -281,8 +281,8 @@ static void init_reply_lookup_names(LSA_R_LOOKUP_NAMES *r_l,
/* Call winbindd to convert sid to name */
-static BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name,
- uint8 *name_type)
+BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name,
+ uint8 *name_type)
{
struct winbindd_request request;
struct winbindd_response response;
@@ -464,8 +464,11 @@ static BOOL lsa_reply_lookup_names(prs_struct *rdata,
api_lsa_open_policy2
***************************************************************************/
-static BOOL api_lsa_open_policy2(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_open_policy2(pipes_struct *p)
{
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
LSA_Q_OPEN_POL2 q_o;
ZERO_STRUCT(q_o);
@@ -488,8 +491,11 @@ static BOOL api_lsa_open_policy2(prs_struct *data, prs_struct *rdata)
/***************************************************************************
api_lsa_open_policy
***************************************************************************/
-static BOOL api_lsa_open_policy(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_open_policy(pipes_struct *p)
{
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
LSA_Q_OPEN_POL q_o;
ZERO_STRUCT(q_o);
@@ -512,9 +518,11 @@ static BOOL api_lsa_open_policy(prs_struct *data, prs_struct *rdata)
/***************************************************************************
api_lsa_enum_trust_dom
***************************************************************************/
-static BOOL api_lsa_enum_trust_dom(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_enum_trust_dom(pipes_struct *p)
{
LSA_Q_ENUM_TRUST_DOM q_e;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
ZERO_STRUCT(q_e);
@@ -531,13 +539,15 @@ static BOOL api_lsa_enum_trust_dom(prs_struct *data, prs_struct *rdata)
/***************************************************************************
api_lsa_query_info
***************************************************************************/
-static BOOL api_lsa_query_info(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_query_info(pipes_struct *p)
{
LSA_Q_QUERY_INFO q_i;
DOM_SID domain_sid;
char *name = NULL;
DOM_SID *sid = NULL;
uint32 status_code = 0;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
ZERO_STRUCT(q_i);
@@ -588,9 +598,12 @@ static BOOL api_lsa_query_info(prs_struct *data, prs_struct *rdata)
api_lsa_lookup_sids
***************************************************************************/
-static BOOL api_lsa_lookup_sids(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_lookup_sids(pipes_struct *p)
{
LSA_Q_LOOKUP_SIDS q_l;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
ZERO_STRUCT(q_l);
/* grab the info class and policy handle */
@@ -610,9 +623,12 @@ static BOOL api_lsa_lookup_sids(prs_struct *data, prs_struct *rdata)
api_lsa_lookup_names
***************************************************************************/
-static BOOL api_lsa_lookup_names(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_lookup_names(pipes_struct *p)
{
LSA_Q_LOOKUP_NAMES q_l;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
ZERO_STRUCT(q_l);
/* grab the info class and policy handle */
@@ -629,9 +645,11 @@ static BOOL api_lsa_lookup_names(prs_struct *data, prs_struct *rdata)
/***************************************************************************
api_lsa_close
***************************************************************************/
-static BOOL api_lsa_close(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_close(pipes_struct *p)
{
LSA_R_CLOSE r_c;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
ZERO_STRUCT(r_c);
@@ -647,11 +665,13 @@ static BOOL api_lsa_close(prs_struct *data, prs_struct *rdata)
/***************************************************************************
api_lsa_open_secret
***************************************************************************/
-static BOOL api_lsa_open_secret(prs_struct *data, prs_struct *rdata)
+static BOOL api_lsa_open_secret(pipes_struct *p)
{
/* XXXX this is NOT good */
size_t i;
uint32 dummy = 0;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
for(i =0; i < 4; i++) {
if(!prs_uint32("api_lsa_close", rdata, 1, &dummy)) {
@@ -689,9 +709,9 @@ static struct api_struct api_lsa_cmds[] =
/***************************************************************************
api_ntLsarpcTNP
***************************************************************************/
-BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data)
+BOOL api_ntlsa_rpc(pipes_struct *p)
{
- return api_rpcTNP(p, "api_ntlsa_rpc", api_lsa_cmds, data);
+ return api_rpcTNP(p, "api_ntlsa_rpc", api_lsa_cmds);
}
#undef OLD_NTDOMAIN
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 11dc5a2f89..46cb521018 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -462,7 +462,7 @@ struct api_cmd
{
char * pipe_clnt_name;
char * pipe_srv_name;
- BOOL (*fn) (pipes_struct *, prs_struct *);
+ BOOL (*fn) (pipes_struct *);
};
static struct api_cmd api_fd_commands[] =
@@ -1116,7 +1116,7 @@ BOOL api_pipe_request(pipes_struct *p)
if (strequal(api_fd_commands[i].pipe_clnt_name, p->name) &&
api_fd_commands[i].fn != NULL) {
DEBUG(3,("Doing \\PIPE\\%s\n", api_fd_commands[i].pipe_clnt_name));
- ret = api_fd_commands[i].fn(p, &p->in_data.data);
+ ret = api_fd_commands[i].fn(p);
}
}
@@ -1130,8 +1130,8 @@ BOOL api_pipe_request(pipes_struct *p)
Calls the underlying RPC function for a named pipe.
********************************************************************/
-BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds,
- prs_struct *rpc_in)
+BOOL api_rpcTNP(pipes_struct *p, char *rpc_name,
+ struct api_struct *api_rpc_cmds)
{
int fn_num;
fstring name;
@@ -1141,7 +1141,7 @@ BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds
DEBUG(4,("api_rpcTNP: %s op 0x%x - ", rpc_name, p->hdr_req.opnum));
slprintf(name, sizeof(name), "in_%s", rpc_name);
- prs_dump(name, p->hdr_req.opnum, rpc_in);
+ prs_dump(name, p->hdr_req.opnum, &p->in_data.data);
for (fn_num = 0; api_rpc_cmds[fn_num].name; fn_num++) {
if (api_rpc_cmds[fn_num].opnum == p->hdr_req.opnum && api_rpc_cmds[fn_num].fn != NULL) {
@@ -1164,7 +1164,7 @@ BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds
offset1 = prs_offset(&p->out_data.rdata);
/* do the actual command */
- if(!api_rpc_cmds[fn_num].fn(rpc_in, &p->out_data.rdata)) {
+ if(!api_rpc_cmds[fn_num].fn(p)) {
DEBUG(0,("api_rpcTNP: %s: failed.\n", rpc_name));
prs_mem_free(&p->out_data.rdata);
return False;
diff --git a/source3/rpc_server/srv_reg.c b/source3/rpc_server/srv_reg.c
index ca3911121f..dd411fc55e 100644
--- a/source3/rpc_server/srv_reg.c
+++ b/source3/rpc_server/srv_reg.c
@@ -60,9 +60,11 @@ static void reg_reply_close(REG_Q_CLOSE *q_r,
/*******************************************************************
api_reg_close
********************************************************************/
-static BOOL api_reg_close(prs_struct *data, prs_struct *rdata )
+static BOOL api_reg_close(pipes_struct *p)
{
REG_Q_CLOSE q_r;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the reg unknown 1 */
reg_io_q_close("", &q_r, data, 0);
@@ -100,9 +102,11 @@ static void reg_reply_open(REG_Q_OPEN_HKLM *q_r,
/*******************************************************************
api_reg_open
********************************************************************/
-static BOOL api_reg_open(prs_struct *data, prs_struct *rdata )
+static BOOL api_reg_open(pipes_struct *p)
{
REG_Q_OPEN_HKLM q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the reg open */
reg_io_q_open_hklm("", &q_u, data, 0);
@@ -165,9 +169,11 @@ static void reg_reply_open_entry(REG_Q_OPEN_ENTRY *q_u,
/*******************************************************************
api_reg_open_entry
********************************************************************/
-static BOOL api_reg_open_entry(prs_struct *data, prs_struct *rdata )
+static BOOL api_reg_open_entry(pipes_struct *p)
{
REG_Q_OPEN_ENTRY q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the reg open entry */
reg_io_q_open_entry("", &q_u, data, 0);
@@ -237,9 +243,11 @@ static void reg_reply_info(REG_Q_INFO *q_u,
/*******************************************************************
api_reg_info
********************************************************************/
-static BOOL api_reg_info(prs_struct *data, prs_struct *rdata )
+static BOOL api_reg_info(pipes_struct *p)
{
REG_Q_INFO q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the reg unknown 0x11*/
reg_io_q_info("", &q_u, data, 0);
@@ -266,8 +274,8 @@ static struct api_struct api_reg_cmds[] =
/*******************************************************************
receives a reg pipe and responds.
********************************************************************/
-BOOL api_reg_rpc(pipes_struct *p, prs_struct *data)
+BOOL api_reg_rpc(pipes_struct *p)
{
- return api_rpcTNP(p, "api_reg_rpc", api_reg_cmds, data);
+ return api_rpcTNP(p, "api_reg_rpc", api_reg_cmds);
}
#undef OLD_NTDOMAIN
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index 49db7a9e48..3ea0ba4615 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -365,9 +365,11 @@ static BOOL samr_reply_close_hnd(SAMR_Q_CLOSE_HND *q_u,
/*******************************************************************
api_samr_close_hnd
********************************************************************/
-static BOOL api_samr_close_hnd(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_close_hnd(pipes_struct *p)
{
SAMR_Q_CLOSE_HND q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr unknown 1 */
if(!samr_io_q_close_hnd("", &q_u, data, 0))
@@ -430,9 +432,11 @@ static BOOL samr_reply_open_domain(SAMR_Q_OPEN_DOMAIN *q_u,
/*******************************************************************
api_samr_open_domain
********************************************************************/
-static BOOL api_samr_open_domain(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_open_domain(pipes_struct *p)
{
SAMR_Q_OPEN_DOMAIN q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_open_domain("", &q_u, data, 0))
@@ -483,9 +487,11 @@ static BOOL samr_reply_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u,
/*******************************************************************
api_samr_unknown_2c
********************************************************************/
-static BOOL api_samr_unknown_2c(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_unknown_2c(pipes_struct *p)
{
SAMR_Q_UNKNOWN_2C q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_unknown_2c("", &q_u, data, 0))
@@ -565,9 +571,11 @@ static BOOL samr_reply_unknown_3(SAMR_Q_UNKNOWN_3 *q_u,
/*******************************************************************
api_samr_unknown_3
********************************************************************/
-static BOOL api_samr_unknown_3(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_unknown_3(pipes_struct *p)
{
SAMR_Q_UNKNOWN_3 q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_unknown_3("", &q_u, data, 0))
@@ -623,9 +631,11 @@ static BOOL samr_reply_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_u,
/*******************************************************************
api_samr_enum_dom_users
********************************************************************/
-static BOOL api_samr_enum_dom_users(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_enum_dom_users(pipes_struct *p)
{
SAMR_Q_ENUM_DOM_USERS q_e;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_enum_dom_users("", &q_e, data, 0))
@@ -684,9 +694,11 @@ static BOOL samr_reply_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_u,
/*******************************************************************
api_samr_enum_dom_groups
********************************************************************/
-static BOOL api_samr_enum_dom_groups(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_enum_dom_groups(pipes_struct *p)
{
SAMR_Q_ENUM_DOM_GROUPS q_e;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_enum_dom_groups("", &q_e, data, 0))
@@ -899,9 +911,11 @@ static BOOL samr_reply_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_u, prs_struct *rd
/*******************************************************************
api_samr_query_dispinfo
********************************************************************/
-static BOOL api_samr_query_dispinfo(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_query_dispinfo(pipes_struct *p)
{
SAMR_Q_QUERY_DISPINFO q_e;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_query_dispinfo("", &q_e, data, 0))
@@ -960,9 +974,11 @@ static BOOL samr_reply_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_u,
/*******************************************************************
api_samr_query_aliasinfo
********************************************************************/
-static BOOL api_samr_query_aliasinfo(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_query_aliasinfo(pipes_struct *p)
{
SAMR_Q_QUERY_ALIASINFO q_e;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open */
if(!samr_io_q_query_aliasinfo("", &q_e, data, 0))
@@ -1043,9 +1059,11 @@ static BOOL samr_reply_lookup_ids(SAMR_Q_LOOKUP_IDS *q_u,
/*******************************************************************
api_samr_lookup_ids
********************************************************************/
-static BOOL api_samr_lookup_ids(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_lookup_ids(pipes_struct *p)
{
SAMR_Q_LOOKUP_IDS q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr 0x10 */
if(!samr_io_q_lookup_ids("", &q_u, data, 0))
@@ -1136,9 +1154,11 @@ static BOOL samr_reply_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u,
api_samr_lookup_names
********************************************************************/
-static BOOL api_samr_lookup_names(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_lookup_names(pipes_struct *p)
{
SAMR_Q_LOOKUP_NAMES q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
memset(&q_u, '\0', sizeof(q_u));
@@ -1195,9 +1215,11 @@ static BOOL samr_reply_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u,
api_samr_chgpasswd_user
********************************************************************/
-static BOOL api_samr_chgpasswd_user(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_chgpasswd_user(pipes_struct *p)
{
SAMR_Q_CHGPASSWD_USER q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* unknown 38 command */
if (!samr_io_q_chgpasswd_user("", &q_u, data, 0)) {
@@ -1237,9 +1259,11 @@ static BOOL samr_reply_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, prs_struct *rdata)
/*******************************************************************
api_samr_unknown_38
********************************************************************/
-static BOOL api_samr_unknown_38(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_unknown_38(pipes_struct *p)
{
SAMR_Q_UNKNOWN_38 q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* unknown 38 command */
if(!samr_io_q_unknown_38("", &q_u, data, 0))
@@ -1304,9 +1328,11 @@ static BOOL samr_reply_unknown_12(SAMR_Q_UNKNOWN_12 *q_u,
/*******************************************************************
api_samr_unknown_12
********************************************************************/
-static BOOL api_samr_unknown_12(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_unknown_12(pipes_struct *p)
{
SAMR_Q_UNKNOWN_12 q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr lookup names */
if(!samr_io_q_unknown_12("", &q_u, data, 0))
@@ -1382,9 +1408,11 @@ static BOOL samr_reply_open_user(SAMR_Q_OPEN_USER *q_u, prs_struct *rdata, int s
/*******************************************************************
api_samr_open_user
********************************************************************/
-static BOOL api_samr_open_user(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_open_user(pipes_struct *p)
{
SAMR_Q_OPEN_USER q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr unknown 22 */
if(!samr_io_q_open_user("", &q_u, data, 0))
@@ -1591,9 +1619,11 @@ static BOOL samr_reply_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u,
/*******************************************************************
api_samr_query_userinfo
********************************************************************/
-static BOOL api_samr_query_userinfo(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_query_userinfo(pipes_struct *p)
{
SAMR_Q_QUERY_USERINFO q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr unknown 24 */
if(!samr_io_q_query_userinfo("", &q_u, data, 0))
@@ -1676,9 +1706,12 @@ static BOOL samr_reply_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u,
/*******************************************************************
api_samr_query_usergroups
********************************************************************/
-static BOOL api_samr_query_usergroups(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_query_usergroups(pipes_struct *p)
{
SAMR_Q_QUERY_USERGROUPS q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
/* grab the samr unknown 32 */
if(!samr_io_q_query_usergroups("", &q_u, data, 0))
return False;
@@ -1748,9 +1781,11 @@ static BOOL samr_reply_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_struct
/*******************************************************************
api_samr_query_dom_info
********************************************************************/
-static BOOL api_samr_query_dom_info(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_query_dom_info(pipes_struct *p)
{
SAMR_Q_QUERY_DOMAIN_INFO q_e;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr unknown 8 command */
if(!samr_io_q_query_dom_info("", &q_e, data, 0))
@@ -1800,11 +1835,13 @@ static BOOL samr_reply_unknown_32(SAMR_Q_UNKNOWN_32 *q_u,
/*******************************************************************
api_samr_unknown_32
********************************************************************/
-static BOOL api_samr_unknown_32(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_unknown_32(pipes_struct *p)
{
uint32 status = 0;
struct sam_passwd *sam_pass;
fstring mach_acct;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
SAMR_Q_UNKNOWN_32 q_u;
@@ -1887,9 +1924,11 @@ static BOOL samr_reply_connect_anon(SAMR_Q_CONNECT_ANON *q_u, prs_struct *rdata)
/*******************************************************************
api_samr_connect_anon
********************************************************************/
-static BOOL api_samr_connect_anon(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_connect_anon(pipes_struct *p)
{
SAMR_Q_CONNECT_ANON q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open policy */
if(!samr_io_q_connect_anon("", &q_u, data, 0))
@@ -1945,9 +1984,11 @@ static BOOL samr_reply_connect(SAMR_Q_CONNECT *q_u, prs_struct *rdata)
/*******************************************************************
api_samr_connect
********************************************************************/
-static BOOL api_samr_connect(prs_struct *data, prs_struct *rdata)
+static BOOL api_samr_connect(pipes_struct *p)
{
SAMR_Q_CONNECT q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open policy */
if(!samr_io_q_connect("", &q_u, data, 0))
@@ -1989,17 +2030,19 @@ static BOOL samr_reply_lookup_domain(SAMR_Q_LOOKUP_DOMAIN* q_u, prs_struct* rdat
/**********************************************************************
api_samr_lookup_domain
**********************************************************************/
-static BOOL api_samr_lookup_domain(prs_struct* data, prs_struct* rdata)
+static BOOL api_samr_lookup_domain(pipes_struct *p)
{
- SAMR_Q_LOOKUP_DOMAIN q_u;
+ SAMR_Q_LOOKUP_DOMAIN q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
- if(!samr_io_q_lookup_domain("", &q_u, data, 0))
+ if(!samr_io_q_lookup_domain("", &q_u, data, 0))
return False;
-
- if(!samr_reply_lookup_domain(&q_u, rdata))
+
+ if(!samr_reply_lookup_domain(&q_u, rdata))
return False;
-
- return True;
+
+ return True;
}
/**********************************************************************
@@ -2030,17 +2073,19 @@ static BOOL samr_reply_enum_domains(SAMR_Q_ENUM_DOMAINS* q_u, prs_struct* rdata)
/**********************************************************************
api_samr_enum_domains
**********************************************************************/
-static BOOL api_samr_enum_domains(prs_struct* data, prs_struct* rdata)
+static BOOL api_samr_enum_domains(pipes_struct *p)
{
- SAMR_Q_ENUM_DOMAINS q_u;
+ SAMR_Q_ENUM_DOMAINS q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
- if(!samr_io_q_enum_domains("", &q_u, data, 0))
+ if(!samr_io_q_enum_domains("", &q_u, data, 0))
return False;
-
- if(!samr_reply_enum_domains(&q_u, rdata))
+
+ if(!samr_reply_enum_domains(&q_u, rdata))
return False;
-
- return True;
+
+ return True;
}
/*******************************************************************
@@ -2086,10 +2131,11 @@ static BOOL samr_reply_open_alias(SAMR_Q_OPEN_ALIAS *q_u, prs_struct *rdata)
/*******************************************************************
api_samr_open_alias
********************************************************************/
-static BOOL api_samr_open_alias(prs_struct *data, prs_struct *rdata)
-
+static BOOL api_samr_open_alias(pipes_struct *p)
{
SAMR_Q_OPEN_ALIAS q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the samr open policy */
if(!samr_io_q_open_alias("", &q_u, data, 0))
@@ -2137,8 +2183,8 @@ static struct api_struct api_samr_cmds [] =
/*******************************************************************
receives a samr pipe and responds.
********************************************************************/
-BOOL api_samr_rpc(pipes_struct *p, prs_struct *data)
+BOOL api_samr_rpc(pipes_struct *p)
{
- return api_rpcTNP(p, "api_samr_rpc", api_samr_cmds, data);
+ return api_rpcTNP(p, "api_samr_rpc", api_samr_cmds);
}
#undef OLD_NTDOMAIN
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c
index 2e8d33d4d2..34f369bc8b 100644
--- a/source3/rpc_server/srv_srvsvc.c
+++ b/source3/rpc_server/srv_srvsvc.c
@@ -926,10 +926,11 @@ static void srv_reply_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *q_n,
/*******************************************************************
********************************************************************/
-static BOOL api_srv_net_srv_get_info(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_srv_get_info(pipes_struct *p)
{
SRV_Q_NET_SRV_GET_INFO q_n;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the net server get info */
srv_io_q_net_srv_get_info("", &q_n, data, 0);
@@ -943,11 +944,12 @@ static BOOL api_srv_net_srv_get_info(prs_struct *data,
/*******************************************************************
********************************************************************/
-static BOOL api_srv_net_file_enum(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_file_enum(pipes_struct *p)
{
SRV_Q_NET_FILE_ENUM q_n;
SRV_FILE_INFO_CTR ctr;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
q_n.ctr = &ctr;
@@ -963,11 +965,12 @@ static BOOL api_srv_net_file_enum(prs_struct *data,
/*******************************************************************
********************************************************************/
-static BOOL api_srv_net_conn_enum(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_conn_enum(pipes_struct *p)
{
SRV_Q_NET_CONN_ENUM q_n;
SRV_CONN_INFO_CTR ctr;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
q_n.ctr = &ctr;
@@ -983,11 +986,12 @@ static BOOL api_srv_net_conn_enum(prs_struct *data,
/*******************************************************************
********************************************************************/
-static BOOL api_srv_net_sess_enum(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_sess_enum(pipes_struct *p)
{
SRV_Q_NET_SESS_ENUM q_n;
SRV_SESS_INFO_CTR ctr;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
q_n.ctr = &ctr;
@@ -1005,11 +1009,12 @@ static BOOL api_srv_net_sess_enum(prs_struct *data,
RPC to enumerate shares.
********************************************************************/
-static BOOL api_srv_net_share_enum(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_share_enum(pipes_struct *p)
{
SRV_Q_NET_SHARE_ENUM q_n;
BOOL ret;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* Unmarshall the net server get enum. */
if(!srv_io_q_net_share_enum("", &q_n, data, 0)) {
@@ -1029,11 +1034,12 @@ static BOOL api_srv_net_share_enum(prs_struct *data,
RPC to return share information.
********************************************************************/
-static BOOL api_srv_net_share_get_info(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_share_get_info(pipes_struct *p)
{
SRV_Q_NET_SHARE_GET_INFO q_n;
BOOL ret;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* Unmarshall the net server get info. */
if(!srv_io_q_net_share_get_info("", &q_n, data, 0)) {
@@ -1092,10 +1098,11 @@ static BOOL srv_reply_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_n,
}
/*******************************************************************
********************************************************************/
-static BOOL api_srv_net_remote_tod(prs_struct *data,
- prs_struct *rdata )
+static BOOL api_srv_net_remote_tod(pipes_struct *p)
{
SRV_Q_NET_REMOTE_TOD q_n;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the net server get enum */
srv_io_q_net_remote_tod("", &q_n, data, 0);
@@ -1125,9 +1132,9 @@ struct api_struct api_srv_cmds[] =
/*******************************************************************
receives a srvsvc pipe and responds.
********************************************************************/
-BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data)
+BOOL api_srvsvc_rpc(pipes_struct *p)
{
- return api_rpcTNP(p, "api_srvsvc_rpc", api_srv_cmds, data);
+ return api_rpcTNP(p, "api_srvsvc_rpc", api_srv_cmds);
}
#undef OLD_NTDOMAIN
diff --git a/source3/rpc_server/srv_wkssvc.c b/source3/rpc_server/srv_wkssvc.c
index a09250a80b..21e4f933f2 100644
--- a/source3/rpc_server/srv_wkssvc.c
+++ b/source3/rpc_server/srv_wkssvc.c
@@ -80,9 +80,11 @@ static BOOL wks_reply_query_info(WKS_Q_QUERY_INFO *q_u,
/*******************************************************************
api_wks_query_info
********************************************************************/
-static BOOL api_wks_query_info(prs_struct *data, prs_struct *rdata)
+static BOOL api_wks_query_info(pipes_struct *p)
{
WKS_Q_QUERY_INFO q_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
/* grab the net share enum */
if(!wks_io_q_query_info("", &q_u, data, 0))
@@ -108,9 +110,9 @@ struct api_struct api_wks_cmds[] =
/*******************************************************************
receives a wkssvc pipe and responds.
********************************************************************/
-BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data)
+BOOL api_wkssvc_rpc(pipes_struct *p)
{
- return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds, data);
+ return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds);
}
#undef OLD_NTDOMAIN