diff options
author | Jeremy Allison <jra@samba.org> | 2001-02-26 22:05:41 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-02-26 22:05:41 +0000 |
commit | de187df10c3d34ef87b3618fc8fc0e14b466b2f8 (patch) | |
tree | 546244b8b6fc411b75405bd487117571bc3dffa5 /source3/rpc_parse | |
parent | 95731132dc3cb78a41fc83c68af0f0168f07f246 (diff) | |
download | samba-de187df10c3d34ef87b3618fc8fc0e14b466b2f8.tar.gz samba-de187df10c3d34ef87b3618fc8fc0e14b466b2f8.tar.bz2 samba-de187df10c3d34ef87b3618fc8fc0e14b466b2f8.zip |
Split srvsvc pipe into interface and implementation modules.
Jeremy.
(This used to be commit e14c88ddf466f17a710724fb4fc273d37a244d77)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_srv.c | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/source3/rpc_parse/parse_srv.c b/source3/rpc_parse/parse_srv.c index c572d881d6..1721b6f187 100644 --- a/source3/rpc_parse/parse_srv.c +++ b/source3/rpc_parse/parse_srv.c @@ -796,14 +796,23 @@ static BOOL srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct Reads or writes a structure. ********************************************************************/ -static BOOL srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth) +static BOOL srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR **pp_ctr, prs_struct *ps, int depth) { - if (ctr == NULL) - return False; + SRV_SESS_INFO_CTR *ctr = *pp_ctr; prs_debug(ps, depth, desc, "srv_io_srv_sess_ctr"); depth++; + if(UNMARSHALLING(ps)) { + ctr = *pp_ctr = (SRV_SESS_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_SESS_INFO_CTR)); + if (ctr == NULL) + return False; + ZERO_STRUCTP(ctr); + } + + if (ctr == NULL) + return False; + if(!prs_align(ps)) return False; @@ -890,7 +899,7 @@ BOOL srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps return False; if (q_n->sess_level != -1) { - if(!srv_io_srv_sess_ctr("sess_ctr", q_n->ctr, ps, depth)) + if(!srv_io_srv_sess_ctr("sess_ctr", &q_n->ctr, ps, depth)) return False; } @@ -922,7 +931,7 @@ BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps return False; if (r_n->sess_level != -1) { - if(!srv_io_srv_sess_ctr("sess_ctr", r_n->ctr, ps, depth)) + if(!srv_io_srv_sess_ctr("sess_ctr", &r_n->ctr, ps, depth)) return False; } @@ -1153,14 +1162,23 @@ static BOOL srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct Reads or writes a structure. ********************************************************************/ -static BOOL srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth) +static BOOL srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR **pp_ctr, prs_struct *ps, int depth) { - if (ctr == NULL) - return False; + SRV_CONN_INFO_CTR *ctr = *pp_ctr; prs_debug(ps, depth, desc, "srv_io_srv_conn_ctr"); depth++; + if (UNMARSHALLING(ps)) { + ctr = *pp_ctr = (SRV_CONN_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_CONN_INFO_CTR)); + if (ctr == NULL) + return False; + ZERO_STRUCTP(ctr); + } + + if (ctr == NULL) + return False; + if(!prs_align(ps)) return False; @@ -1247,7 +1265,7 @@ BOOL srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps return False; if (q_n->conn_level != -1) { - if(!srv_io_srv_conn_ctr("conn_ctr", q_n->ctr, ps, depth)) + if(!srv_io_srv_conn_ctr("conn_ctr", &q_n->ctr, ps, depth)) return False; } @@ -1279,7 +1297,7 @@ BOOL srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *p return False; if (r_n->conn_level != -1) { - if(!srv_io_srv_conn_ctr("conn_ctr", r_n->ctr, ps, depth)) + if(!srv_io_srv_conn_ctr("conn_ctr", &r_n->ctr, ps, depth)) return False; } @@ -1427,8 +1445,17 @@ static BOOL srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct Reads or writes a structure. ********************************************************************/ -static BOOL srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth) +static BOOL srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR **pp_ctr, prs_struct *ps, int depth) { + SRV_FILE_INFO_CTR *ctr = *pp_ctr; + + if (UNMARSHALLING(ps)) { + ctr = *pp_ctr = (SRV_FILE_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_FILE_INFO_CTR)); + if (ctr == NULL) + return False; + ZERO_STRUCTP(ctr); + } + if (ctr == NULL) return False; @@ -1517,7 +1544,7 @@ BOOL srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps return False; if (q_n->file_level != -1) { - if(!srv_io_srv_file_ctr("file_ctr", q_n->ctr, ps, depth)) + if(!srv_io_srv_file_ctr("file_ctr", &q_n->ctr, ps, depth)) return False; } @@ -1549,7 +1576,7 @@ BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps return False; if (r_n->file_level != 0) { - if(!srv_io_srv_file_ctr("file_ctr", r_n->ctr, ps, depth)) + if(!srv_io_srv_file_ctr("file_ctr", &r_n->ctr, ps, depth)) return False; } |