diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_at.c | 72 | ||||
-rw-r--r-- | source3/rpc_parse/parse_eventlog.c | 56 | ||||
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 242 | ||||
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 340 | ||||
-rw-r--r-- | source3/rpc_parse/parse_net.c | 294 | ||||
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 42 | ||||
-rw-r--r-- | source3/rpc_parse/parse_reg.c | 317 | ||||
-rw-r--r-- | source3/rpc_parse/parse_rpc.c | 192 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 1261 | ||||
-rw-r--r-- | source3/rpc_parse/parse_sec.c | 86 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 517 | ||||
-rw-r--r-- | source3/rpc_parse/parse_srv.c | 384 | ||||
-rw-r--r-- | source3/rpc_parse/parse_svc.c | 162 | ||||
-rw-r--r-- | source3/rpc_parse/parse_wks.c | 36 |
14 files changed, 2712 insertions, 1289 deletions
diff --git a/source3/rpc_parse/parse_at.c b/source3/rpc_parse/parse_at.c index 2eb72c8aea..87507230c0 100644 --- a/source3/rpc_parse/parse_at.c +++ b/source3/rpc_parse/parse_at.c @@ -28,7 +28,7 @@ extern int DEBUGLEVEL; /******************************************************************* make_at_q_add_job ********************************************************************/ -void make_at_q_add_job(AT_Q_ADD_JOB *q_a, char *server, +BOOL make_at_q_add_job(AT_Q_ADD_JOB *q_a, char *server, AT_JOB_INFO *info, char *command) { DEBUG(5,("make_at_q_add_job\n")); @@ -36,14 +36,16 @@ void make_at_q_add_job(AT_Q_ADD_JOB *q_a, char *server, make_buf_unistr2(&(q_a->uni_srv_name), &(q_a->ptr_srv_name), server); memcpy(&(q_a->info), info, sizeof(q_a->info)); make_unistr2(&(q_a->command), command, strlen(command)+1); + + return True; } /******************************************************************* reads or writes a AT_JOB_INFO structure. ********************************************************************/ -void at_io_job_info(char *desc, AT_JOB_INFO *info, prs_struct *ps, int depth) +BOOL at_io_job_info(char *desc, AT_JOB_INFO *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "at_io_job_info"); depth++; @@ -57,14 +59,16 @@ void at_io_job_info(char *desc, AT_JOB_INFO *info, prs_struct *ps, int depth) prs_align(ps); prs_uint32("ptr_command", ps, depth, &(info->ptr_command)); + + return True; } /******************************************************************* reads or writes a AT_Q_ADD_JOB structure. ********************************************************************/ -void at_io_q_add_job(char *desc, AT_Q_ADD_JOB *q_a, prs_struct *ps, int depth) +BOOL at_io_q_add_job(char *desc, AT_Q_ADD_JOB *q_a, prs_struct *ps, int depth) { - if (q_a == NULL) return; + if (q_a == NULL) return False; prs_debug(ps, depth, desc, "at_q_add_job"); depth++; @@ -74,14 +78,16 @@ void at_io_q_add_job(char *desc, AT_Q_ADD_JOB *q_a, prs_struct *ps, int depth) smb_io_unistr2("", &(q_a->uni_srv_name), q_a->ptr_srv_name, ps, depth); at_io_job_info("", &(q_a->info), ps, depth); smb_io_unistr2("", &(q_a->command), q_a->info.ptr_command, ps, depth); + + return True; } /******************************************************************* reads or writes a AT_R_ADD_JOB structure. ********************************************************************/ -void at_io_r_add_job(char *desc, AT_R_ADD_JOB *r_a, prs_struct *ps, int depth) +BOOL at_io_r_add_job(char *desc, AT_R_ADD_JOB *r_a, prs_struct *ps, int depth) { - if (r_a == NULL) return; + if (r_a == NULL) return False; prs_debug(ps, depth, desc, "at_r_add_job"); depth++; @@ -89,12 +95,14 @@ void at_io_r_add_job(char *desc, AT_R_ADD_JOB *r_a, prs_struct *ps, int depth) prs_align(ps); prs_uint32("jobid", ps, depth, &(r_a->jobid)); prs_uint32("status", ps, depth, &(r_a->status)); + + return True; } /******************************************************************* make_at_q_del_job ********************************************************************/ -void make_at_q_del_job(AT_Q_DEL_JOB *q_a, char *server, uint32 min_jobid, +BOOL make_at_q_del_job(AT_Q_DEL_JOB *q_a, char *server, uint32 min_jobid, uint32 max_jobid) { DEBUG(5,("make_at_q_del_job\n")); @@ -102,14 +110,16 @@ void make_at_q_del_job(AT_Q_DEL_JOB *q_a, char *server, uint32 min_jobid, make_buf_unistr2(&(q_a->uni_srv_name), &(q_a->ptr_srv_name), server); q_a->min_jobid = min_jobid; q_a->max_jobid = max_jobid; + + return True; } /******************************************************************* reads or writes a AT_Q_DEL_JOB structure. ********************************************************************/ -void at_io_q_del_job(char *desc, AT_Q_DEL_JOB *q_d, prs_struct *ps, int depth) +BOOL at_io_q_del_job(char *desc, AT_Q_DEL_JOB *q_d, prs_struct *ps, int depth) { - if (q_d == NULL) return; + if (q_d == NULL) return False; prs_debug(ps, depth, desc, "at_q_del_job"); depth++; @@ -121,26 +131,30 @@ void at_io_q_del_job(char *desc, AT_Q_DEL_JOB *q_d, prs_struct *ps, int depth) prs_align(ps); prs_uint32("min_jobid", ps, depth, &(q_d->min_jobid)); prs_uint32("max_jobid", ps, depth, &(q_d->max_jobid)); + + return True; } /******************************************************************* reads or writes a AT_R_DEL_JOB structure. ********************************************************************/ -void at_io_r_del_job(char *desc, AT_R_DEL_JOB *r_d, prs_struct *ps, int depth) +BOOL at_io_r_del_job(char *desc, AT_R_DEL_JOB *r_d, prs_struct *ps, int depth) { - if (r_d == NULL) return; + if (r_d == NULL) return False; prs_debug(ps, depth, desc, "at_r_del_job"); depth++; prs_align(ps); prs_uint32("status", ps, depth, &(r_d->status)); + + return True; } /******************************************************************* make_at_q_enum_jobs ********************************************************************/ -void make_at_q_enum_jobs(AT_Q_ENUM_JOBS *q_e, char *server) +BOOL make_at_q_enum_jobs(AT_Q_ENUM_JOBS *q_e, char *server) { DEBUG(5,("make_at_q_enum_jobs\n")); @@ -150,14 +164,16 @@ void make_at_q_enum_jobs(AT_Q_ENUM_JOBS *q_e, char *server) q_e->max_len = 0xffff; q_e->ptr_resume = 1; q_e->hnd_resume = 0; + + return True; } /******************************************************************* reads or writes a AT_Q_ENUM_JOBS structure. ********************************************************************/ -void at_io_q_enum_jobs(char *desc, AT_Q_ENUM_JOBS *q_e, prs_struct *ps, int depth) +BOOL at_io_q_enum_jobs(char *desc, AT_Q_ENUM_JOBS *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "at_q_enum_jobs"); depth++; @@ -172,14 +188,16 @@ void at_io_q_enum_jobs(char *desc, AT_Q_ENUM_JOBS *q_e, prs_struct *ps, int dept prs_uint32("ptr_resume", ps, depth, &(q_e->ptr_resume)); prs_uint32("hnd_resume", ps, depth, &(q_e->hnd_resume)); + + return True; } /******************************************************************* reads or writes a AT_R_ENUM_JOBS structure. ********************************************************************/ -void at_io_r_enum_jobs(char *desc, AT_R_ENUM_JOBS *r_e, prs_struct *ps, int depth) +BOOL at_io_r_enum_jobs(char *desc, AT_R_ENUM_JOBS *r_e, prs_struct *ps, int depth) { - if (r_e == NULL) return; + if (r_e == NULL) return False; prs_debug(ps, depth, desc, "at_r_enum_jobs"); depth++; @@ -196,7 +214,7 @@ void at_io_r_enum_jobs(char *desc, AT_R_ENUM_JOBS *r_e, prs_struct *ps, int dept if (r_e->num_entries2 != r_e->num_entries) { /* RPC fault */ - return; + return False; } SMB_ASSERT_ARRAY(r_e->info, r_e->num_entries2); @@ -222,25 +240,29 @@ void at_io_r_enum_jobs(char *desc, AT_R_ENUM_JOBS *r_e, prs_struct *ps, int dept prs_uint32("hnd_resume" , ps, depth, &(r_e->hnd_resume )); prs_uint32("status", ps, depth, &(r_e->status)); + + return True; } /******************************************************************* make_at_q_query_job ********************************************************************/ -void make_at_q_query_job(AT_Q_QUERY_JOB *q_q, char *server, uint32 jobid) +BOOL make_at_q_query_job(AT_Q_QUERY_JOB *q_q, char *server, uint32 jobid) { DEBUG(5,("make_at_q_query_job\n")); make_buf_unistr2(&(q_q->uni_srv_name), &(q_q->ptr_srv_name), server); q_q->jobid = jobid; + + return True; } /******************************************************************* reads or writes a AT_Q_QUERY_JOB structure. ********************************************************************/ -void at_io_q_query_job(char *desc, AT_Q_QUERY_JOB *q_q, prs_struct *ps, int depth) +BOOL at_io_q_query_job(char *desc, AT_Q_QUERY_JOB *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "at_q_query_job"); depth++; @@ -250,14 +272,16 @@ void at_io_q_query_job(char *desc, AT_Q_QUERY_JOB *q_q, prs_struct *ps, int dept smb_io_unistr2("", &(q_q->uni_srv_name), q_q->ptr_srv_name, ps, depth); prs_align(ps); prs_uint32("jobid", ps, depth, &(q_q->jobid)); + + return True; } /******************************************************************* reads or writes a AT_R_QUERY_JOB structure. ********************************************************************/ -void at_io_r_query_job(char *desc, AT_R_QUERY_JOB *r_q, prs_struct *ps, int depth) +BOOL at_io_r_query_job(char *desc, AT_R_QUERY_JOB *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "at_r_query_job"); depth++; @@ -272,4 +296,6 @@ void at_io_r_query_job(char *desc, AT_R_QUERY_JOB *r_q, prs_struct *ps, int dept prs_align(ps); prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } diff --git a/source3/rpc_parse/parse_eventlog.c b/source3/rpc_parse/parse_eventlog.c index 9ebc6287d4..6cf476711d 100644 --- a/source3/rpc_parse/parse_eventlog.c +++ b/source3/rpc_parse/parse_eventlog.c @@ -2,8 +2,8 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1998, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1998, + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, * Copyright (C) Jean François Micouleau 1998-1999. * * This program is free software; you can redistribute it and/or modify @@ -27,7 +27,7 @@ extern int DEBUGLEVEL; /******************************************************************* ********************************************************************/ -void make_eventlog_q_open(EVENTLOG_Q_OPEN *q_u, char *journal, char *unk) +BOOL make_eventlog_q_open(EVENTLOG_Q_OPEN *q_u, char *journal, char *unk) { int len_journal = journal != NULL ? strlen(journal) : 0; int len_unk = unk != NULL ? strlen(unk) : 0; @@ -44,11 +44,13 @@ void make_eventlog_q_open(EVENTLOG_Q_OPEN *q_u, char *journal, char *unk) q_u->unk6=0x01; q_u->unk7=0x01; + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_q_open(char *desc, EVENTLOG_Q_OPEN *q_u, prs_struct *ps, int depth) +BOOL eventlog_io_q_open(char *desc, EVENTLOG_Q_OPEN *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_q_open"); depth++; @@ -72,11 +74,13 @@ void eventlog_io_q_open(char *desc, EVENTLOG_Q_OPEN *q_u, prs_struct *ps, int de prs_uint32("unk6", ps, depth, &(q_u->unk6)); prs_uint32("unk7", ps, depth, &(q_u->unk7)); + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_r_open(char *desc, EVENTLOG_R_OPEN *r_u, prs_struct *ps, int depth) +BOOL eventlog_io_r_open(char *desc, EVENTLOG_R_OPEN *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_r_open"); depth++; @@ -84,29 +88,35 @@ void eventlog_io_r_open(char *desc, EVENTLOG_R_OPEN *r_u, prs_struct *ps, int de prs_align(ps); smb_io_pol_hnd("", &(r_u->pol), ps, depth); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void make_eventlog_q_close(EVENTLOG_Q_CLOSE *q_u, POLICY_HND *pol) +BOOL make_eventlog_q_close(EVENTLOG_Q_CLOSE *q_u, POLICY_HND *pol) { memcpy(&(q_u->pol.data), pol->data, sizeof(q_u->pol.data)); + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_q_close(char *desc, EVENTLOG_Q_CLOSE *q_u, prs_struct *ps, int depth) +BOOL eventlog_io_q_close(char *desc, EVENTLOG_Q_CLOSE *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_q_close"); depth++; prs_align(ps); smb_io_pol_hnd("", &(q_u->pol), ps, depth); + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_r_close(char *desc, EVENTLOG_R_CLOSE *r_u, prs_struct *ps, int depth) +BOOL eventlog_io_r_close(char *desc, EVENTLOG_R_CLOSE *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_r_close"); depth++; @@ -114,19 +124,23 @@ void eventlog_io_r_close(char *desc, EVENTLOG_R_CLOSE *r_u, prs_struct *ps, int prs_align(ps); smb_io_pol_hnd("", &(r_u->pol), ps, depth); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void make_eventlog_q_numofeventlogrec(EVENTLOG_Q_NUMOFEVENTLOGREC *q_u, POLICY_HND *pol) +BOOL make_eventlog_q_numofeventlogrec(EVENTLOG_Q_NUMOFEVENTLOGREC *q_u, POLICY_HND *pol) { memcpy(&(q_u->pol.data), pol->data, sizeof(q_u->pol.data)); + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_q_numofeventlogrec(char *desc,EVENTLOG_Q_NUMOFEVENTLOGREC *q_u, prs_struct *ps, int depth) +BOOL eventlog_io_q_numofeventlogrec(char *desc,EVENTLOG_Q_NUMOFEVENTLOGREC *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_q_numofeventlogrec"); depth++; @@ -134,11 +148,13 @@ void eventlog_io_q_numofeventlogrec(char *desc,EVENTLOG_Q_NUMOFEVENTLOGREC *q_u prs_align(ps); smb_io_pol_hnd("", &(q_u->pol), ps, depth); + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_r_numofeventlogrec(char *desc, EVENTLOG_R_NUMOFEVENTLOGREC *r_u, prs_struct *ps, int depth) +BOOL eventlog_io_r_numofeventlogrec(char *desc, EVENTLOG_R_NUMOFEVENTLOGREC *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_r_numofeventlogrec"); depth++; @@ -146,22 +162,26 @@ void eventlog_io_r_numofeventlogrec(char *desc, EVENTLOG_R_NUMOFEVENTLOGREC *r_u prs_align(ps); prs_uint32("number", ps, depth, &(r_u->number)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void make_eventlog_q_readeventlog(EVENTLOG_Q_READEVENTLOG *q_u, POLICY_HND *pol, +BOOL make_eventlog_q_readeventlog(EVENTLOG_Q_READEVENTLOG *q_u, POLICY_HND *pol, uint32 flags, uint32 offset, uint32 number_of_bytes) { memcpy(&(q_u->pol.data), pol->data, sizeof(q_u->pol.data)); q_u->flags=flags; q_u->offset=offset; q_u->number_of_bytes=number_of_bytes; + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_q_readeventlog(char *desc, EVENTLOG_Q_READEVENTLOG *q_u, prs_struct *ps, int depth) +BOOL eventlog_io_q_readeventlog(char *desc, EVENTLOG_Q_READEVENTLOG *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_q_readeventlog"); depth++; @@ -171,11 +191,13 @@ void eventlog_io_q_readeventlog(char *desc, EVENTLOG_Q_READEVENTLOG *q_u, prs_st prs_uint32("flags", ps, depth, &(q_u->flags)); prs_uint32("offset", ps, depth, &(q_u->offset)); prs_uint32("number_of_bytes", ps, depth, &(q_u->number_of_bytes)); + + return True; } /******************************************************************* ********************************************************************/ -static void eventlog_io_eventlog(char *desc, EVENTLOGRECORD *ev, prs_struct *ps, int depth) +static BOOL eventlog_io_eventlog(char *desc, EVENTLOGRECORD *ev, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_eventlog"); depth++; @@ -213,11 +235,13 @@ static void eventlog_io_eventlog(char *desc, EVENTLOGRECORD *ev, prs_struct *ps, smb_io_unistr("", &(ev->data), ps, depth); prs_uint32("size2", ps, depth, &(ev->size2)); + + return True; } /******************************************************************* ********************************************************************/ -void eventlog_io_r_readeventlog(char *desc, EVENTLOG_R_READEVENTLOG *r_u, prs_struct *ps, int depth) +BOOL eventlog_io_r_readeventlog(char *desc, EVENTLOG_R_READEVENTLOG *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "eventlog_io_r_readeventlog"); depth++; @@ -231,5 +255,7 @@ void eventlog_io_r_readeventlog(char *desc, EVENTLOG_R_READEVENTLOG *r_u, prs_st prs_uint32("sent_size", ps, depth, &(r_u->sent_size)); prs_uint32("real_size", ps, depth, &(r_u->real_size)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index cff4c027e1..1f194aa874 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -2,9 +2,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ extern int DEBUGLEVEL; /******************************************************************* creates a LSA_TRANS_NAME structure. ********************************************************************/ -void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, +BOOL make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, uint32 sid_name_use, char *name, uint32 idx) { int len_name = strlen(name); @@ -38,14 +38,16 @@ void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, make_uni_hdr(&(trn->hdr_name), len_name); make_unistr2(uni_name, name, len_name); trn->domain_idx = idx; + + return True; } /******************************************************************* reads or writes a LSA_TRANS_NAME structure. ********************************************************************/ -static void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth) +static BOOL lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth) { - if (trn == NULL) return; + if (trn == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_trans_name"); depth++; @@ -55,19 +57,21 @@ static void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, i prs_uint32("sid_name_use", ps, depth, &(trn->sid_name_use)); smb_io_unihdr ("hdr_name", &(trn->hdr_name), ps, depth); prs_uint32("domain_idx ", ps, depth, &(trn->domain_idx )); + + return True; } /******************************************************************* reads or writes a DOM_R_REF structure. ********************************************************************/ -static void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) +static BOOL lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) { int i, s, n; prs_debug(ps, depth, desc, "smb_io_dom_r_ref"); depth++; - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_align(ps); @@ -112,16 +116,18 @@ static void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int de } } } + + return True; } /******************************************************************* makes an LSA_SEC_QOS structure. ********************************************************************/ -void make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff, +BOOL make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff, uint32 unknown) { - if (qos == NULL) return; + if (qos == NULL) return False; DEBUG(5,("make_lsa_sec_qos\n")); @@ -130,16 +136,18 @@ void make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff, qos->sec_ctxt_mode = ctxt; qos->effective_only = eff; qos->unknown = unknown; + + return True; } /******************************************************************* reads or writes an LSA_SEC_QOS structure. ********************************************************************/ -static void lsa_io_sec_qos(char *desc, LSA_SEC_QOS *qos, prs_struct *ps, int depth) +static BOOL lsa_io_sec_qos(char *desc, LSA_SEC_QOS *qos, prs_struct *ps, int depth) { int start; - if (qos == NULL) return; + if (qos == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_obj_qos"); depth++; @@ -162,15 +170,17 @@ static void lsa_io_sec_qos(char *desc, LSA_SEC_QOS *qos, prs_struct *ps, int de DEBUG(3,("lsa_io_sec_qos: length %x does not match size %x\n", qos->len, ps->offset - start)); } + + return True; } /******************************************************************* makes an LSA_OBJ_ATTR structure. ********************************************************************/ -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos) +BOOL make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos) { - if (attr == NULL) return; + if (attr == NULL) return False; DEBUG(5,("make_lsa_obj_attr\n")); @@ -190,16 +200,18 @@ void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos) attr->ptr_sec_qos = 0; attr->sec_qos = NULL; } + + return True; } /******************************************************************* reads or writes an LSA_OBJ_ATTR structure. ********************************************************************/ -static void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) +static BOOL lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) { int start; - if (attr == NULL) return; + if (attr == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_obj_attr"); depth++; @@ -228,18 +240,20 @@ static void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int { lsa_io_sec_qos("sec_qos", attr->sec_qos, ps, depth); } + + return True; } /******************************************************************* makes an LSA_Q_OPEN_POL structure. ********************************************************************/ -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name, +BOOL make_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name, uint32 attributes, uint32 desired_access, LSA_SEC_QOS *qos) { - if (r_q == NULL) return; + if (r_q == NULL) return False; DEBUG(5,("make_open_pol: attr:%d da:%d\n", attributes, desired_access)); @@ -252,14 +266,16 @@ void make_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name, r_q->system_name = system_name; make_lsa_obj_attr(&(r_q->attr ), attributes, qos); + + return True; } /******************************************************************* reads or writes an LSA_Q_OPEN_POL structure. ********************************************************************/ -void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth) +BOOL lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_open_pol"); depth++; @@ -274,14 +290,16 @@ void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int dep { prs_uint32("des_access", ps, depth, &(r_q->des_access)); } + + return True; } /******************************************************************* reads or writes an LSA_R_OPEN_POL structure. ********************************************************************/ -void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth) +BOOL lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth) { - if (r_p == NULL) return; + if (r_p == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_open_pol"); depth++; @@ -289,17 +307,19 @@ void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int dep smb_io_pol_hnd("", &(r_p->pol), ps, depth); prs_uint32("status", ps, depth, &(r_p->status)); + + return True; } /******************************************************************* makes an LSA_Q_OPEN_POL2 structure. ********************************************************************/ -void make_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, char *server_name, +BOOL make_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, char *server_name, uint32 attributes, uint32 desired_access, LSA_SEC_QOS *qos) { - if (r_q == NULL) return; + if (r_q == NULL) return False; DEBUG(5,("make_open_pol2: attr:%d da:%d\n", attributes, desired_access)); @@ -312,14 +332,16 @@ void make_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, char *server_name, make_unistr2 (&(r_q->uni_server_name), server_name, strlen(server_name)); make_lsa_obj_attr(&(r_q->attr ), attributes, qos); + + return True; } /******************************************************************* reads or writes an LSA_Q_OPEN_POL2 structure. ********************************************************************/ -void lsa_io_q_open_pol2(char *desc, LSA_Q_OPEN_POL2 *r_q, prs_struct *ps, int depth) +BOOL lsa_io_q_open_pol2(char *desc, LSA_Q_OPEN_POL2 *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_open_pol2"); depth++; @@ -333,14 +355,16 @@ void lsa_io_q_open_pol2(char *desc, LSA_Q_OPEN_POL2 *r_q, prs_struct *ps, int d { prs_uint32("des_access", ps, depth, &(r_q->des_access)); } + + return True; } /******************************************************************* reads or writes an LSA_R_OPEN_POL2 structure. ********************************************************************/ -void lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps, int depth) +BOOL lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps, int depth) { - if (r_p == NULL) return; + if (r_p == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_open_pol2"); depth++; @@ -348,28 +372,34 @@ void lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps, int d smb_io_pol_hnd("", &(r_p->pol), ps, depth); prs_uint32("status", ps, depth, &(r_p->status)); + + return True; + + return True; } /******************************************************************* makes an LSA_Q_QUERY_INFO structure. ********************************************************************/ -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class) +BOOL make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class) { - if (q_q == NULL || hnd == NULL) return; + if (q_q == NULL || hnd == NULL) return False; DEBUG(5,("make_q_query\n")); memcpy(&(q_q->pol), hnd, sizeof(q_q->pol)); q_q->info_class = info_class; + + return True; } /******************************************************************* reads or writes an LSA_Q_QUERY_INFO structure. ********************************************************************/ -void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth) +BOOL lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_query"); depth++; @@ -377,17 +407,19 @@ void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int dept smb_io_pol_hnd("", &(q_q->pol), ps, depth); prs_uint16("info_class", ps, depth, &(q_q->info_class)); + + return True; } /******************************************************************* makes an LSA_Q_OPEN_SECRET structure. ********************************************************************/ -void make_q_open_secret(LSA_Q_OPEN_SECRET *q_o, POLICY_HND *pol_hnd, +BOOL make_q_open_secret(LSA_Q_OPEN_SECRET *q_o, POLICY_HND *pol_hnd, char *secret_name, uint32 desired_access) { int len = strlen(secret_name); - if (q_o == NULL) return; + if (q_o == NULL) return False; DEBUG(5,("make_q_open_secret")); @@ -397,14 +429,16 @@ void make_q_open_secret(LSA_Q_OPEN_SECRET *q_o, POLICY_HND *pol_hnd, make_unistr2(&(q_o->uni_secret), secret_name, len); q_o->des_access = desired_access; + + return True; } /******************************************************************* reads or writes an LSA_Q_OPEN_SECRET structure. ********************************************************************/ -void lsa_io_q_open_secret(char *desc, LSA_Q_OPEN_SECRET *q_o, prs_struct *ps, int depth) +BOOL lsa_io_q_open_secret(char *desc, LSA_Q_OPEN_SECRET *q_o, prs_struct *ps, int depth) { - if (q_o == NULL) return; + if (q_o == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_open_secret"); depth++; @@ -417,14 +451,16 @@ void lsa_io_q_open_secret(char *desc, LSA_Q_OPEN_SECRET *q_o, prs_struct *ps, in prs_align(ps); prs_uint32("des_access", ps, depth, &(q_o->des_access)); + + return True; } /******************************************************************* reads or writes an LSA_R_OPEN_SECRET structure. ********************************************************************/ -void lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_o, prs_struct *ps, int depth) +BOOL lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_o, prs_struct *ps, int depth) { - if (r_o == NULL) return; + if (r_o == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_open_secret"); depth++; @@ -432,14 +468,16 @@ void lsa_io_r_open_secret(char *desc, LSA_R_OPEN_SECRET *r_o, prs_struct *ps, in smb_io_pol_hnd("", &(r_o->pol), ps, depth); prs_uint32("status", ps, depth, &(r_o->status)); + + return True; } /******************************************************************* reads or writes an LSA_SECRET_VALUE structure. ********************************************************************/ -void lsa_io_secret_value(char *desc, LSA_SECRET_VALUE *value, prs_struct *ps, int depth) +BOOL lsa_io_secret_value(char *desc, LSA_SECRET_VALUE *value, prs_struct *ps, int depth) { - if (value == NULL) return; + if (value == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_secret_value"); depth++; @@ -453,14 +491,16 @@ void lsa_io_secret_value(char *desc, LSA_SECRET_VALUE *value, prs_struct *ps, in smb_io_string2("secret" , &(value->enc_secret), value->hdr_secret.buffer, ps, depth); } + + return True; } /******************************************************************* reads or writes an LSA_SECRET_INFO structure. ********************************************************************/ -void lsa_io_secret_info(char *desc, LSA_SECRET_INFO *info, prs_struct *ps, int depth) +BOOL lsa_io_secret_info(char *desc, LSA_SECRET_INFO *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_secret_info"); depth++; @@ -484,14 +524,16 @@ void lsa_io_secret_info(char *desc, LSA_SECRET_INFO *info, prs_struct *ps, int d smb_io_time("last_update", &(info->last_update), ps, depth); } + + return True; } /******************************************************************* makes an LSA_Q_QUERY_SECRET structure. ********************************************************************/ -void make_q_query_secret(LSA_Q_QUERY_SECRET *q_q, POLICY_HND *pol) +BOOL make_q_query_secret(LSA_Q_QUERY_SECRET *q_q, POLICY_HND *pol) { - if (q_q == NULL) return; + if (q_q == NULL) return False; DEBUG(5,("make_q_query_secret\n")); @@ -507,14 +549,16 @@ void make_q_query_secret(LSA_Q_QUERY_SECRET *q_q, POLICY_HND *pol) /* Don't care about old info */ q_q->oldinfo.ptr_value = 0; q_q->oldinfo.ptr_update = 0; + + return True; } /******************************************************************* reads or writes an LSA_Q_QUERY_SECRET structure. ********************************************************************/ -void lsa_io_q_query_secret(char *desc, LSA_Q_QUERY_SECRET *q_q, prs_struct *ps, int depth) +BOOL lsa_io_q_query_secret(char *desc, LSA_Q_QUERY_SECRET *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_query_secret"); depth++; @@ -523,14 +567,16 @@ void lsa_io_q_query_secret(char *desc, LSA_Q_QUERY_SECRET *q_q, prs_struct *ps, lsa_io_secret_info("", &(q_q->info ), ps, depth); lsa_io_secret_info("", &(q_q->oldinfo), ps, depth); + + return True; } /******************************************************************* reads or writes an LSA_Q_QUERY_SECRET structure. ********************************************************************/ -void lsa_io_r_query_secret(char *desc, LSA_R_QUERY_SECRET *r_q, prs_struct *ps, int depth) +BOOL lsa_io_r_query_secret(char *desc, LSA_R_QUERY_SECRET *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_query_secret"); depth++; @@ -540,14 +586,16 @@ void lsa_io_r_query_secret(char *desc, LSA_R_QUERY_SECRET *r_q, prs_struct *ps, prs_align(ps); prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* reads or writes an LSA_Q_ENUM_TRUST_DOM structure. ********************************************************************/ -void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth) +BOOL lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_enum_trust_dom"); depth++; @@ -557,16 +605,18 @@ void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct prs_uint32("enum_context ", ps, depth, &(q_e->enum_context )); prs_uint32("preferred_len", ps, depth, &(q_e->preferred_len)); + + return True; } /******************************************************************* makes an LSA_R_ENUM_TRUST_DOM structure. ********************************************************************/ -void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, +BOOL make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context, char *domain_name, DOM_SID *domain_sid, uint32 status) { - if (r_e == NULL) return; + if (r_e == NULL) return False; DEBUG(5,("make_r_enum_trust_dom\n")); @@ -591,14 +641,16 @@ void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, } r_e->status = status; + + return True; } /******************************************************************* reads or writes an LSA_R_ENUM_TRUST_DOM structure. ********************************************************************/ -void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth) +BOOL lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth) { - if (r_e == NULL) return; + if (r_e == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_enum_trust_dom"); depth++; @@ -616,14 +668,16 @@ void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct } prs_uint32("status", ps, depth, &(r_e->status)); + + return True; } /******************************************************************* reads or writes an LSA_Q_QUERY_INFO structure. ********************************************************************/ -void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth) +BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_query"); depth++; @@ -655,15 +709,17 @@ void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int dept } prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* makes a LSA_SID_ENUM structure. ********************************************************************/ -void make_lsa_sid_enum(LSA_SID_ENUM *sen, int num_entries, DOM_SID **sids) +BOOL make_lsa_sid_enum(LSA_SID_ENUM *sen, int num_entries, DOM_SID **sids) { int i, i2; - if (sen == NULL || sids == NULL) return; + if (sen == NULL || sids == NULL) return False; DEBUG(5,("make_lsa_sid_enum\n")); @@ -686,17 +742,19 @@ void make_lsa_sid_enum(LSA_SID_ENUM *sen, int num_entries, DOM_SID **sids) sen->ptr_sid[i] = 0; } } + + return True; } /******************************************************************* reads or writes a LSA_SID_ENUM structure. ********************************************************************/ -static void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, +static BOOL lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth) { int i; - if (sen == NULL) return; + if (sen == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_sid_enum"); depth++; @@ -724,17 +782,19 @@ static void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, slprintf(temp, sizeof(temp) - 1, "sid[%d]", i); smb_io_dom_sid2(temp, &(sen->sid[i]), ps, depth); /* domain SIDs to be looked up. */ } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, +static BOOL lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth) { int i; - if (trn == NULL) return; + if (trn == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_trans_names"); depth++; @@ -766,16 +826,18 @@ static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_align(ps); } } + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd, +BOOL make_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd, int num_sids, DOM_SID **sids, uint16 level) { - if (q_l == NULL) return; + if (q_l == NULL) return False; DEBUG(5,("make_q_lookup_sids\n")); @@ -786,14 +848,16 @@ void make_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd, q_l->names.num_entries = 0; q_l->level.value = level; + + return True; } /******************************************************************* reads or writes a LSA_Q_LOOKUP_SIDS structure. ********************************************************************/ -void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth) +BOOL lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth) { - if (q_s == NULL) return; + if (q_s == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_lookup_sids"); depth++; @@ -806,14 +870,16 @@ void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, in smb_io_lookup_level("switch ", &(q_s->level ), ps, depth); /* lookup level */ prs_uint32("mapped_count", ps, depth, &(q_s->mapped_count)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth) +BOOL lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth) { - if (r_s == NULL) return; + if (r_s == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_lookup_sids"); depth++; @@ -832,16 +898,18 @@ void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, i prs_uint32("mapped_count", ps, depth, &(r_s->mapped_count)); prs_uint32("status ", ps, depth, &(r_s->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_q_lookup_names(LSA_Q_LOOKUP_NAMES *q_l, POLICY_HND *hnd, +BOOL make_q_lookup_names(LSA_Q_LOOKUP_NAMES *q_l, POLICY_HND *hnd, int num_names, const char **names) { int i; - if (q_l == NULL) return; + if (q_l == NULL) return False; DEBUG(5,("make_q_lookup_names\n")); @@ -864,16 +932,18 @@ void make_q_lookup_names(LSA_Q_LOOKUP_NAMES *q_l, POLICY_HND *hnd, q_l->ptr_trans_sids = 0; q_l->lookup_level = 1; q_l->mapped_count = 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void lsa_io_q_lookup_names(char *desc, LSA_Q_LOOKUP_NAMES *q_r, prs_struct *ps, int depth) +BOOL lsa_io_q_lookup_names(char *desc, LSA_Q_LOOKUP_NAMES *q_r, prs_struct *ps, int depth) { int i; - if (q_r == NULL) return; + if (q_r == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_lookup_names"); depth++; @@ -902,16 +972,18 @@ void lsa_io_q_lookup_names(char *desc, LSA_Q_LOOKUP_NAMES *q_r, prs_struct *ps, prs_uint32("ptr_trans_sids ", ps, depth, &(q_r->ptr_trans_sids)); prs_uint32("lookup_level ", ps, depth, &(q_r->lookup_level )); prs_uint32("mapped_count ", ps, depth, &(q_r->mapped_count )); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r, prs_struct *ps, int depth) +BOOL lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r, prs_struct *ps, int depth) { int i; - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_lookup_names"); depth++; @@ -934,7 +1006,7 @@ void lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r, prs_struct *ps, if (r_r->num_entries2 != r_r->num_entries) { /* RPC fault */ - return; + return False; } for (i = 0; i < r_r->num_entries2; i++) @@ -946,40 +1018,46 @@ void lsa_io_r_lookup_names(char *desc, LSA_R_LOOKUP_NAMES *r_r, prs_struct *ps, prs_uint32("mapped_count", ps, depth, &(r_r->mapped_count)); prs_uint32("status ", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* makes an LSA_Q_CLOSE structure. ********************************************************************/ -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd) +BOOL make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_lsa_q_close\n")); memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); + + return True; } /******************************************************************* reads or writes an LSA_Q_CLOSE structure. ********************************************************************/ -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth) +BOOL lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth) { - if (q_c == NULL) return; + if (q_c == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_q_close"); depth++; smb_io_pol_hnd("", &(q_c->pol), ps, depth); + + return True; } /******************************************************************* reads or writes an LSA_R_CLOSE structure. ********************************************************************/ -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth) +BOOL lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth) { - if (r_c == NULL) return; + if (r_c == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_r_close"); depth++; @@ -987,5 +1065,7 @@ void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth) smb_io_pol_hnd("", &(r_c->pol), ps, depth); prs_uint32("status", ps, depth, &(r_c->status)); + + return True; } diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index e46a6e02a5..31dc252187 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -31,9 +31,9 @@ extern int DEBUGLEVEL; /******************************************************************* reads or writes a BIGINT structure. ********************************************************************/ -void smb_io_bigint(char *desc, BIGINT *bigint, prs_struct *ps, int depth) +BOOL smb_io_bigint(char *desc, BIGINT *bigint, prs_struct *ps, int depth) { - if (bigint == NULL) return; + if (bigint == NULL) return False; prs_debug(ps, depth, desc, "smb_io_bigint"); depth++; @@ -42,14 +42,16 @@ void smb_io_bigint(char *desc, BIGINT *bigint, prs_struct *ps, int depth) prs_uint32("low ", ps, depth, &(bigint->low )); prs_uint32("high", ps, depth, &(bigint->high)); + + return True; } /******************************************************************* reads or writes a UTIME type. ********************************************************************/ -static void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth) +static BOOL smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth) { - if (t == NULL) return; + if (t == NULL) return False; prs_debug(ps, depth, desc, "smb_io_utime"); depth++; @@ -57,14 +59,16 @@ static void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth) prs_align(ps); prs_uint32 ("time", ps, depth, &(t->time)); + + return True; } /******************************************************************* reads or writes an NTTIME structure. ********************************************************************/ -void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth) +BOOL smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth) { - if (nttime == NULL) return; + if (nttime == NULL) return False; prs_debug(ps, depth, desc, "smb_io_time"); depth++; @@ -73,14 +77,16 @@ void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth) prs_uint32("low ", ps, depth, &(nttime->low )); /* low part */ prs_uint32("high", ps, depth, &(nttime->high)); /* high part */ + + return True; } /******************************************************************* reads or writes a LOOKUP_LEVEL structure. ********************************************************************/ -void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth) +BOOL smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth) { - if (level == NULL) return; + if (level == NULL) return False; prs_debug(ps, depth, desc, "smb_io_lookup_level"); depth++; @@ -88,6 +94,8 @@ void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int de prs_align(ps); prs_uint16("value", ps, depth, &(level->value)); prs_align(ps); + + return True; } /******************************************************************* @@ -96,27 +104,31 @@ gets an enumeration handle from an ENUM_HND structure. uint32 get_enum_hnd(ENUM_HND *enh) { return (enh && enh->ptr_hnd != 0) ? enh->handle : 0; + + return True; } /******************************************************************* makes an ENUM_HND structure. ********************************************************************/ -void make_enum_hnd(ENUM_HND *enh, uint32 hnd) +BOOL make_enum_hnd(ENUM_HND *enh, uint32 hnd) { - if (enh == NULL) return; + if (enh == NULL) return False; DEBUG(5,("smb_io_enum_hnd\n")); enh->ptr_hnd = (hnd != 0) ? 1 : 0; enh->handle = hnd; + + return True; } /******************************************************************* reads or writes an ENUM_HND structure. ********************************************************************/ -void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth) +BOOL smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth) { - if (hnd == NULL) return; + if (hnd == NULL) return False; prs_debug(ps, depth, desc, "smb_io_enum_hnd"); depth++; @@ -128,16 +140,18 @@ void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth) { prs_uint32("handle ", ps, depth, &(hnd->handle )); /* enum handle */ } + + return True; } /******************************************************************* reads or writes a DOM_SID structure. ********************************************************************/ -void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth) +BOOL smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth) { int i; - if (sid == NULL) return; + if (sid == NULL) return False; prs_debug(ps, depth, desc, "smb_io_dom_sid"); depth++; @@ -158,23 +172,27 @@ void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth) if (sid->num_auths > MAXSUBAUTHS) sid->num_auths = MAXSUBAUTHS; prs_uint32s(False, "sub_auths ", ps, depth, sid->sub_auths, sid->num_auths); + + return True; } /******************************************************************* creates a DOM_SID2 structure. ********************************************************************/ -void make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid) +BOOL make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid) { sid_copy(&sid2->sid, sid); sid2->num_auths = sid2->sid.num_auths; + + return True; } /******************************************************************* reads or writes a DOM_SID2 structure. ********************************************************************/ -void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth) +BOOL smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth) { - if (sid == NULL) return; + if (sid == NULL) return False; prs_debug(ps, depth, desc, "smb_io_dom_sid2"); depth++; @@ -184,24 +202,28 @@ void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth) prs_uint32("num_auths", ps, depth, &(sid->num_auths)); smb_io_dom_sid("sid", &(sid->sid), ps, depth); + + return True; } /******************************************************************* creates a STRHDR structure. ********************************************************************/ -void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer) +BOOL make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer) { hdr->str_max_len = max_len; hdr->str_str_len = len; hdr->buffer = buffer; + + return True; } /******************************************************************* reads or writes a STRHDR structure. ********************************************************************/ -void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth) +BOOL smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth) { - if (hdr == NULL) return; + if (hdr == NULL) return False; prs_debug(ps, depth, desc, "smb_io_strhdr"); depth++; @@ -215,24 +237,28 @@ void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth) /* oops! XXXX maybe issue a warning that this is happening... */ if (hdr->str_max_len > MAX_STRINGLEN) hdr->str_max_len = MAX_STRINGLEN; if (hdr->str_str_len > MAX_STRINGLEN) hdr->str_str_len = MAX_STRINGLEN; + + return True; } /******************************************************************* creates a STRHDR2 structure. ********************************************************************/ -void make_strhdr2(STRHDR2 *hdr, uint32 max_len, uint32 len, uint32 buffer) +BOOL make_strhdr2(STRHDR2 *hdr, uint32 max_len, uint32 len, uint32 buffer) { hdr->str_max_len = max_len; hdr->str_str_len = len; hdr->buffer = buffer; + + return True; } /******************************************************************* reads or writes a STRHDR2 structure. ********************************************************************/ -void smb_io_strhdr2(char *desc, STRHDR2 *hdr, prs_struct *ps, int depth) +BOOL smb_io_strhdr2(char *desc, STRHDR2 *hdr, prs_struct *ps, int depth) { - if (hdr == NULL) return; + if (hdr == NULL) return False; prs_debug(ps, depth, desc, "smb_io_strhdr"); depth++; @@ -246,24 +272,28 @@ void smb_io_strhdr2(char *desc, STRHDR2 *hdr, prs_struct *ps, int depth) /* oops! XXXX maybe issue a warning that this is happening... */ if (hdr->str_max_len > MAX_STRINGLEN) hdr->str_max_len = MAX_STRINGLEN; if (hdr->str_str_len > MAX_STRINGLEN) hdr->str_str_len = MAX_STRINGLEN; + + return True; } /******************************************************************* creates a UNIHDR structure. ********************************************************************/ -void make_uni_hdr(UNIHDR *hdr, int len) +BOOL make_uni_hdr(UNIHDR *hdr, int len) { hdr->uni_str_len = 2 * len; hdr->uni_max_len = 2 * len; hdr->buffer = len != 0 ? 1 : 0; + + return True; } /******************************************************************* reads or writes a UNIHDR structure. ********************************************************************/ -void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth) +BOOL smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth) { - if (hdr == NULL) return; + if (hdr == NULL) return False; prs_debug(ps, depth, desc, "smb_io_unihdr"); depth++; @@ -277,22 +307,26 @@ void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth) /* oops! XXXX maybe issue a warning that this is happening... */ if (hdr->uni_max_len > MAX_UNISTRLEN) hdr->uni_max_len = MAX_UNISTRLEN; if (hdr->uni_str_len > MAX_UNISTRLEN) hdr->uni_str_len = MAX_UNISTRLEN; + + return True; } /******************************************************************* creates a BUFHDR structure. ********************************************************************/ -void make_buf_hdr(BUFHDR *hdr, int max_len, int len) +BOOL make_buf_hdr(BUFHDR *hdr, int max_len, int len) { hdr->buf_max_len = max_len; hdr->buf_len = len; + + return True; } /******************************************************************* prs_uint16 wrapper. call this and it sets up a pointer to where the uint16 should be stored, or gets the size if reading ********************************************************************/ -void smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset) +BOOL smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset) { (*offset) = ps->offset; if (ps->io) @@ -304,13 +338,15 @@ void smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint { ps->offset += sizeof(uint32) * 2; } + + return True; } /******************************************************************* smb_io_hdrbuf wrapper. call this and it retrospectively stores the size. does nothing on reading, as that is already handled by ...._pre() ********************************************************************/ -void smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, +BOOL smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 ptr_hdrbuf, uint32 max_len, uint32 len) { if (!ps->io) @@ -323,14 +359,16 @@ void smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, smb_io_hdrbuf(desc, hdr, ps, depth); ps->offset = old_offset; } + + return True; } /******************************************************************* reads or writes a BUFHDR structure. ********************************************************************/ -void smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth) +BOOL smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth) { - if (hdr == NULL) return; + if (hdr == NULL) return False; prs_debug(ps, depth, desc, "smb_io_hdrbuf"); depth++; @@ -343,24 +381,28 @@ void smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth) /* oops! XXXX maybe issue a warning that this is happening... */ if (hdr->buf_max_len > MAX_BUFFERLEN) hdr->buf_max_len = MAX_BUFFERLEN; if (hdr->buf_len > MAX_BUFFERLEN) hdr->buf_len = MAX_BUFFERLEN; + + return True; } /******************************************************************* creates a BUFHDR2 structure. ********************************************************************/ -void make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer) +BOOL make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer) { hdr->info_level = info_level; hdr->length = length; hdr->buffer = buffer; + + return True; } /******************************************************************* reads or writes a BUFHDR2 structure. ********************************************************************/ -void smb_io_bufhdr2(char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth) +BOOL smb_io_bufhdr2(char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth) { - if (hdr == NULL) return; + if (hdr == NULL) return False; prs_debug(ps, depth, desc, "smb_io_bufhdr2"); depth++; @@ -369,23 +411,27 @@ void smb_io_bufhdr2(char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth) prs_uint32("info_level", ps, depth, &(hdr->info_level)); prs_uint32("length ", ps, depth, &(hdr->length )); prs_uint32("buffer ", ps, depth, &(hdr->buffer )); + + return True; } /******************************************************************* creates a UNIHDR2 structure. ********************************************************************/ -void make_uni_hdr2(UNIHDR2 *hdr, int len) +BOOL make_uni_hdr2(UNIHDR2 *hdr, int len) { make_uni_hdr(&(hdr->unihdr), len); hdr->buffer = len > 0 ? 1 : 0; + + return True; } /******************************************************************* reads or writes a UNIHDR2 structure. ********************************************************************/ -void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth) +BOOL smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth) { - if (hdr2 == NULL) return; + if (hdr2 == NULL) return False; prs_debug(ps, depth, desc, "smb_io_unihdr2"); depth++; @@ -394,34 +440,40 @@ void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth) smb_io_unihdr("hdr", &(hdr2->unihdr), ps, depth); prs_uint32("buffer", ps, depth, &(hdr2->buffer)); + + return True; } /******************************************************************* creates a UNISTR structure. ********************************************************************/ -void make_unistr(UNISTR *str, char *buf) +BOOL make_unistr(UNISTR *str, char *buf) { ascii_to_unistr(str->buffer, buf, sizeof(str->buffer)-1); + + return True; } /******************************************************************* reads or writes a UNISTR structure. XXXX NOTE: UNISTR structures NEED to be null-terminated. ********************************************************************/ -void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth) +BOOL smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth) { - if (uni == NULL) return; + if (uni == NULL) return False; prs_debug(ps, depth, desc, "smb_io_unistr"); depth++; prs_unistr("unistr", ps, depth, uni); + + return True; } /******************************************************************* creates a BUFFER3 structure from a uint32 ********************************************************************/ -void make_buffer3_uint32(BUFFER3 *str, uint32 val) +BOOL make_buffer3_uint32(BUFFER3 *str, uint32 val) { ZERO_STRUCTP(str); @@ -430,12 +482,14 @@ void make_buffer3_uint32(BUFFER3 *str, uint32 val) str->buf_len = sizeof(uint32); SIVAL(str->buffer, 0, val); + + return True; } /******************************************************************* creates a BUFFER3 structure. ********************************************************************/ -void make_buffer3_str(BUFFER3 *str, char *buf, int len) +BOOL make_buffer3_str(BUFFER3 *str, char *buf, int len) { ZERO_STRUCTP(str); @@ -445,21 +499,25 @@ void make_buffer3_str(BUFFER3 *str, char *buf, int len) /* store the string (little endian buffer) */ ascii_to_unibuf(str->buffer, buf, str->buf_len); + + return True; } /******************************************************************* creates a BUFFER3 structure from a hex string. ********************************************************************/ -void make_buffer3_hex(BUFFER3 *str, char *buf) +BOOL make_buffer3_hex(BUFFER3 *str, char *buf) { ZERO_STRUCTP(str); str->buf_max_len = str->buf_len = strhex_to_str((char *)str->buffer, sizeof(str->buffer), buf); + + return True; } /******************************************************************* creates a BUFFER3 structure. ********************************************************************/ -void make_buffer3_bytes(BUFFER3 *str, uint8 *buf, int len) +BOOL make_buffer3_bytes(BUFFER3 *str, uint8 *buf, int len) { ZERO_STRUCTP(str); @@ -470,6 +528,8 @@ void make_buffer3_bytes(BUFFER3 *str, uint8 *buf, int len) memcpy(str->buffer, buf, MIN(str->buf_len, sizeof(str->buffer))); } str->buf_len = buf != NULL ? len : 0; + + return True; } /******************************************************************* @@ -477,9 +537,9 @@ reads or writes a BUFFER3 structure. the uni_max_len member tells you how large the buffer is. the uni_str_len member tells you how much of the buffer is really used. ********************************************************************/ -void smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth) +BOOL smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth) { - if (buf3 == NULL) return; + if (buf3 == NULL) return False; prs_debug(ps, depth, desc, "smb_io_buffer3"); depth++; @@ -493,14 +553,16 @@ void smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth) prs_uint32("buf_len ", ps, depth, &(buf3->buf_len)); if (buf3->buf_len > MAX_UNISTRLEN) buf3->buf_len = MAX_UNISTRLEN; + + return True; } /******************************************************************* reads or writes a BUFFER4 structure. ********************************************************************/ -void smb_io_buffer4(char *desc, BUFFER4 *buf4, uint32 buffer, prs_struct *ps, int depth) +BOOL smb_io_buffer4(char *desc, BUFFER4 *buf4, uint32 buffer, prs_struct *ps, int depth) { - if ((buf4 == NULL) || (buffer == 0)) return; + if ((buf4 == NULL) || (buffer == 0)) return False; prs_debug(ps, depth, desc, "smb_io_buffer4"); depth++; @@ -514,12 +576,14 @@ void smb_io_buffer4(char *desc, BUFFER4 *buf4, uint32 buffer, prs_struct *ps, in } prs_uint8s(True, "buffer", ps, depth, buf4->buffer, buf4->buf_len); + + return True; } /******************************************************************* initialise a BUFFER5 structure. ********************************************************************/ -void init_buffer5(BUFFER5 **str) +BOOL init_buffer5(BUFFER5 **str) { BUFFER5 *buf5; @@ -528,12 +592,14 @@ void init_buffer5(BUFFER5 **str) buf5->buf_len=0; buf5->buffer=NULL; *str=buf5; + + return True; } /******************************************************************* clear a BUFFER5 structure. ********************************************************************/ -void clear_buffer5(BUFFER5 **str) +BOOL clear_buffer5(BUFFER5 **str) { BUFFER5 *buf5; @@ -544,30 +610,34 @@ void clear_buffer5(BUFFER5 **str) } free(buf5); *str=NULL; + + return True; } /******************************************************************* creates a BUFFER5 structure. ********************************************************************/ -void make_buffer5(BUFFER5 *str, char *buf, int len) +BOOL make_buffer5(BUFFER5 *str, char *buf, int len) { /* max buffer size (allocated size) */ str->buf_len = len; str->buffer = (uint16 *)malloc( sizeof(uint16) * len ); ascii_to_unistr(str->buffer, buf, len); + + return True; } /******************************************************************* reads or writes a BUFFER5 structure. the buf_len member tells you how large the buffer is. ********************************************************************/ -void smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth) +BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "smb_io_buffer4"); depth++; - if (buf5 == NULL) return; + if (buf5 == NULL) return False; prs_align(ps); prs_uint32("buf_len", ps, depth, &(buf5->buf_len)); @@ -579,12 +649,14 @@ void smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth) } prs_uint16s(True, "buffer ", ps, depth, buf5->buffer, buf5->buf_len); + + return True; } /******************************************************************* creates a BUFFER2 structure. ********************************************************************/ -void make_buffer2(BUFFER2 *str, const char *buf, int len) +BOOL make_buffer2(BUFFER2 *str, const char *buf, int len) { ZERO_STRUCTP(str); @@ -594,6 +666,8 @@ void make_buffer2(BUFFER2 *str, const char *buf, int len) /* store the string */ ascii_to_unibuf(str->buffer, buf, MIN(str->buf_len, sizeof(str->buffer)-1)); + + return True; } /******************************************************************* @@ -601,9 +675,9 @@ reads or writes a BUFFER2 structure. the uni_max_len member tells you how large the buffer is. the uni_str_len member tells you how much of the buffer is really used. ********************************************************************/ -void smb_io_buffer2(char *desc, BUFFER2 *buf2, uint32 buffer, prs_struct *ps, int depth) +BOOL smb_io_buffer2(char *desc, BUFFER2 *buf2, uint32 buffer, prs_struct *ps, int depth) { - if (buf2 == NULL) return; + if (buf2 == NULL) return False; if (buffer) { @@ -630,12 +704,14 @@ void smb_io_buffer2(char *desc, BUFFER2 *buf2, uint32 buffer, prs_struct *ps, i depth++; bzero(buf2, sizeof(*buf2)); } + + return True; } /******************************************************************* creates a UNISTR2 structure: sets up the buffer, too ********************************************************************/ -void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf) +BOOL make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf) { if (buf != NULL) { @@ -647,12 +723,14 @@ void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf) *ptr = 0; make_unistr2(str, "", 0); } + + return True; } /******************************************************************* copies a UNISTR2 structure. ********************************************************************/ -void copy_unistr2(UNISTR2 *str, UNISTR2 *from) +BOOL copy_unistr2(UNISTR2 *str, UNISTR2 *from) { /* set up string lengths. add one if string is not null-terminated */ str->uni_max_len = from->uni_max_len; @@ -661,12 +739,14 @@ void copy_unistr2(UNISTR2 *str, UNISTR2 *from) /* copy the string */ memcpy(str->buffer, from->buffer, sizeof(from->buffer)); + + return True; } /******************************************************************* creates a STRING2 structure. ********************************************************************/ -void make_string2(STRING2 *str, char *buf, int len) +BOOL make_string2(STRING2 *str, char *buf, int len) { /* set up string lengths. */ str->str_max_len = len; @@ -676,6 +756,8 @@ void make_string2(STRING2 *str, char *buf, int len) /* store the string */ if(len != 0) memcpy(str->buffer, buf, len); + + return True; } /******************************************************************* @@ -684,9 +766,9 @@ XXXX NOTE: STRING2 structures need NOT be null-terminated. the str_str_len member tells you how long the string is; the str_max_len member tells you how large the buffer is. ********************************************************************/ -void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth) +BOOL smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth) { - if (str2 == NULL) return; + if (str2 == NULL) return False; if (buffer) { @@ -713,12 +795,14 @@ void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, i depth++; bzero(str2, sizeof(*str2)); } + + return True; } /******************************************************************* creates a UNISTR2 structure. ********************************************************************/ -void make_unistr2(UNISTR2 *str, const char *buf, int len) +BOOL make_unistr2(UNISTR2 *str, const char *buf, int len) { ZERO_STRUCTP(str); @@ -729,6 +813,8 @@ void make_unistr2(UNISTR2 *str, const char *buf, int len) /* store the string (wide chars) */ ascii_to_unistr(str->buffer, buf, len); + + return True; } /******************************************************************* @@ -737,9 +823,9 @@ XXXX NOTE: UNISTR2 structures need NOT be null-terminated. the uni_str_len member tells you how long the string is; the uni_max_len member tells you how large the buffer is. ********************************************************************/ -void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth) +BOOL smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth) { - if (uni2 == NULL) return; + if (uni2 == NULL) return False; if (buffer) { @@ -766,24 +852,28 @@ void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, i depth++; bzero(uni2, sizeof(*uni2)); } + + return True; } /******************************************************************* creates a DOM_RID2 structure. ********************************************************************/ -void make_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint8 type, uint32 idx) +BOOL make_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint8 type, uint32 idx) { rid2->type = type; rid2->rid = rid; rid2->rid_idx = idx; + + return True; } /******************************************************************* reads or writes a DOM_RID2 structure. ********************************************************************/ -void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth) +BOOL smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth) { - if (rid2 == NULL) return; + if (rid2 == NULL) return False; prs_debug(ps, depth, desc, "smb_io_dom_rid2"); depth++; @@ -794,26 +884,30 @@ void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth) prs_align(ps); prs_uint32("rid ", ps, depth, &(rid2->rid )); prs_uint32("rid_idx", ps, depth, &(rid2->rid_idx )); + + return True; } /******************************************************************* creates a DOM_RID3 structure. ********************************************************************/ -void make_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type) +BOOL make_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type) { rid3->rid = rid; rid3->type1 = type; rid3->ptr_type = 0x1; /* non-zero, basically. */ rid3->type2 = 0x1; rid3->unk = type; + + return True; } /******************************************************************* reads or writes a DOM_RID3 structure. ********************************************************************/ -void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth) +BOOL smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth) { - if (rid3 == NULL) return; + if (rid3 == NULL) return False; prs_debug(ps, depth, desc, "smb_io_dom_rid3"); depth++; @@ -825,14 +919,16 @@ void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth) prs_uint32("ptr_type", ps, depth, &(rid3->ptr_type)); prs_uint32("type2 ", ps, depth, &(rid3->type2 )); prs_uint32("unk ", ps, depth, &(rid3->unk )); + + return True; } /******************************************************************* makes a DOM_CLNT_SRV structure. ********************************************************************/ -static void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name) +static BOOL make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name) { - if (log == NULL) return; + if (log == NULL) return False; DEBUG(5,("make_clnt_srv: %d\n", __LINE__)); @@ -855,14 +951,16 @@ static void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name) { log->undoc_buffer2 = 0; } + + return True; } /******************************************************************* reads or writes a DOM_CLNT_SRV structure. ********************************************************************/ -static void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth) +static BOOL smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth) { - if (log == NULL) return; + if (log == NULL) return False; prs_debug(ps, depth, desc, "smb_io_clnt_srv"); depth++; @@ -882,16 +980,18 @@ static void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int { smb_io_unistr2("unistr2", &(log->uni_comp_name), log->undoc_buffer2, ps, depth); } + + return True; } /******************************************************************* makes a DOM_LOG_INFO structure. ********************************************************************/ -void make_log_info(DOM_LOG_INFO *log, +BOOL make_log_info(DOM_LOG_INFO *log, const char *logon_srv, const char *acct_name, uint16 sec_chan, const char *comp_name) { - if (log == NULL) return; + if (log == NULL) return False; DEBUG(5,("make_log_info %d\n", __LINE__)); @@ -903,14 +1003,16 @@ void make_log_info(DOM_LOG_INFO *log, log->sec_chan = sec_chan; make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name)+1); + + return True; } /******************************************************************* reads or writes a DOM_LOG_INFO structure. ********************************************************************/ -void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth) +BOOL smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth) { - if (log == NULL) return; + if (log == NULL) return False; prs_debug(ps, depth, desc, "smb_io_log_info"); depth++; @@ -925,14 +1027,16 @@ void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth) prs_uint16("sec_chan", ps, depth, &(log->sec_chan)); smb_io_unistr2("unistr2", &(log->uni_comp_name), True, ps, depth); + + return True; } /******************************************************************* reads or writes a DOM_CHAL structure. ********************************************************************/ -void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth) +BOOL smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth) { - if (chal == NULL) return; + if (chal == NULL) return False; prs_debug(ps, depth, desc, "smb_io_chal"); depth++; @@ -940,14 +1044,16 @@ void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth) prs_align(ps); prs_uint8s (False, "data", ps, depth, chal->data, 8); + + return True; } /******************************************************************* reads or writes a DOM_CRED structure. ********************************************************************/ -void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth) +BOOL smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth) { - if (cred == NULL) return; + if (cred == NULL) return False; prs_debug(ps, depth, desc, "smb_io_cred"); depth++; @@ -956,16 +1062,18 @@ void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth) smb_io_chal ("", &(cred->challenge), ps, depth); smb_io_utime("", &(cred->timestamp), ps, depth); + + return True; } /******************************************************************* makes a DOM_CLNT_INFO2 structure. ********************************************************************/ -void make_clnt_info2(DOM_CLNT_INFO2 *clnt, +BOOL make_clnt_info2(DOM_CLNT_INFO2 *clnt, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred) { - if (clnt == NULL) return; + if (clnt == NULL) return False; DEBUG(5,("make_clnt_info: %d\n", __LINE__)); @@ -980,14 +1088,16 @@ void make_clnt_info2(DOM_CLNT_INFO2 *clnt, { clnt->ptr_cred = 0; } + + return True; } /******************************************************************* reads or writes a DOM_CLNT_INFO2 structure. ********************************************************************/ -void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth) +BOOL smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth) { - if (clnt == NULL) return; + if (clnt == NULL) return False; prs_debug(ps, depth, desc, "smb_io_clnt_info2"); depth++; @@ -1000,30 +1110,34 @@ void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int de prs_uint32("ptr_cred", ps, depth, &(clnt->ptr_cred)); smb_io_cred ("", &(clnt->cred ), ps, depth); + + return True; } /******************************************************************* makes a DOM_CLNT_INFO structure. ********************************************************************/ -void make_clnt_info(DOM_CLNT_INFO *clnt, +BOOL make_clnt_info(DOM_CLNT_INFO *clnt, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CRED *cred) { - if (clnt == NULL || cred == NULL) return; + if (clnt == NULL || cred == NULL) return False; DEBUG(5,("make_clnt_info\n")); make_log_info(&(clnt->login), logon_srv, acct_name, sec_chan, comp_name); memcpy(&(clnt->cred), cred, sizeof(clnt->cred)); + + return True; } /******************************************************************* reads or writes a DOM_CLNT_INFO structure. ********************************************************************/ -void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth) +BOOL smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth) { - if (clnt == NULL) return; + if (clnt == NULL) return False; prs_debug(ps, depth, desc, "smb_io_clnt_info"); depth++; @@ -1032,14 +1146,16 @@ void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int dept smb_io_log_info("", &(clnt->login), ps, depth); smb_io_cred ("", &(clnt->cred ), ps, depth); + + return True; } /******************************************************************* makes an OWF_INFO structure. ********************************************************************/ -void make_owf_info(OWF_INFO *hash, uint8 data[16]) +BOOL make_owf_info(OWF_INFO *hash, uint8 data[16]) { - if (hash == NULL) return; + if (hash == NULL) return False; DEBUG(5,("make_owf_info: %d\n", __LINE__)); @@ -1051,14 +1167,16 @@ void make_owf_info(OWF_INFO *hash, uint8 data[16]) { bzero(hash->data, sizeof(hash->data)); } + + return True; } /******************************************************************* reads or writes an OWF_INFO structure. ********************************************************************/ -void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth) +BOOL smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth) { - if (hash == NULL) return; + if (hash == NULL) return False; prs_debug(ps, depth, desc, "smb_io_owf_info"); depth++; @@ -1066,14 +1184,16 @@ void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth) prs_align(ps); prs_uint8s (False, "data", ps, depth, hash->data, 16); + + return True; } /******************************************************************* reads or writes a DOM_GID structure. ********************************************************************/ -void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth) +BOOL smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth) { - if (gid == NULL) return; + if (gid == NULL) return False; prs_debug(ps, depth, desc, "smb_io_gid"); depth++; @@ -1082,14 +1202,16 @@ void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth) prs_uint32("g_rid", ps, depth, &(gid->g_rid)); prs_uint32("attr ", ps, depth, &(gid->attr )); + + return True; } /******************************************************************* reads or writes an POLICY_HND structure. ********************************************************************/ -void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth) +BOOL smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth) { - if (pol == NULL) return; + if (pol == NULL) return False; prs_debug(ps, depth, desc, "smb_io_pol_hnd"); depth++; @@ -1097,14 +1219,16 @@ void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth) prs_align(ps); prs_uint8s (False, "data", ps, depth, pol->data, POL_HND_SIZE); + + return True; } /******************************************************************* reads or writes a dom query structure. ********************************************************************/ -static void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth) +static BOOL smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth) { - if (d_q == NULL) return; + if (d_q == NULL) return False; prs_debug(ps, depth, desc, "smb_io_dom_query"); depth++; @@ -1129,31 +1253,37 @@ static void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int de { bzero(&(d_q->dom_sid), sizeof(d_q->dom_sid)); } + + return True; } /******************************************************************* reads or writes a dom query structure. ********************************************************************/ -void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) +BOOL smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) { smb_io_dom_query("", d_q, ps, depth); + + return True; } /******************************************************************* reads or writes a dom query structure. ********************************************************************/ -void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) +BOOL smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) { smb_io_dom_query("", d_q, ps, depth); + + return True; } /******************************************************************* reads or writes a UNISTR3 structure. ********************************************************************/ -void smb_io_unistr3(char *desc, UNISTR3 *name, prs_struct *ps, int depth) +BOOL smb_io_unistr3(char *desc, UNISTR3 *name, prs_struct *ps, int depth) { - if (name == NULL) return; + if (name == NULL) return False; prs_debug(ps, depth, desc, "smb_io_unistr3"); depth++; @@ -1166,5 +1296,7 @@ void smb_io_unistr3(char *desc, UNISTR3 *name, prs_struct *ps, int depth) /* assume unicode string is unicode-null-terminated, instead */ prs_unistr3(True, "unistr", name, ps, depth); + + return True; } diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index 79b49855a9..e2073d00f1 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -29,9 +29,9 @@ extern int DEBUGLEVEL; /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth) +static BOOL net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth) { - if (neg == NULL) return; + if (neg == NULL) return False; prs_debug(ps, depth, desc, "net_io_neg_flags"); depth++; @@ -39,12 +39,14 @@ static void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int de prs_align(ps); prs_uint32("neg_flags", ps, depth, &(neg->neg_flags)); + + return True; } /******************************************************************* creates a NETLOGON_INFO_3 structure. ********************************************************************/ -static void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts) +static BOOL make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts) { info->flags = flags; info->logon_attempts = logon_attempts; @@ -53,14 +55,16 @@ static void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_att info->reserved_3 = 0x0; info->reserved_4 = 0x0; info->reserved_5 = 0x0; + + return True; } /******************************************************************* reads or writes a NETLOGON_INFO_3 structure. ********************************************************************/ -static void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth) +static BOOL net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_netinfo_3"); depth++; @@ -74,24 +78,28 @@ static void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, prs_uint32("reserved_3 ", ps, depth, &(info->reserved_3 )); prs_uint32("reserved_4 ", ps, depth, &(info->reserved_4 )); prs_uint32("reserved_5 ", ps, depth, &(info->reserved_5 )); + + return True; } /******************************************************************* creates a NETLOGON_INFO_1 structure. ********************************************************************/ -static void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status) +static BOOL make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status) { info->flags = flags; info->pdc_status = pdc_status; + + return True; } /******************************************************************* reads or writes a NETLOGON_INFO_1 structure. ********************************************************************/ -static void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth) +static BOOL net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_netinfo_1"); depth++; @@ -100,12 +108,14 @@ static void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, prs_uint32("flags ", ps, depth, &(info->flags )); prs_uint32("pdc_status", ps, depth, &(info->pdc_status)); + + return True; } /******************************************************************* creates a NETLOGON_INFO_2 structure. ********************************************************************/ -static void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, +static BOOL make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, uint32 tc_status, char *trusted_dc_name) { int len_dc_name = strlen(trusted_dc_name); @@ -122,14 +132,16 @@ static void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_statu { make_unistr2(&(info->uni_trusted_dc_name), "", 1); } + + return True; } /******************************************************************* reads or writes a NETLOGON_INFO_2 structure. ********************************************************************/ -static void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth) +static BOOL net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_netinfo_2"); depth++; @@ -147,14 +159,16 @@ static void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, } prs_align(ps); + + return True; } /******************************************************************* reads or writes an NET_Q_LOGON_CTRL2 structure. ********************************************************************/ -void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth) +BOOL net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth) { - if (q_l == NULL) return; + if (q_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_logon_ctrl2"); depth++; @@ -170,16 +184,18 @@ void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, i prs_uint32("function_code", ps, depth, &(q_l->function_code)); prs_uint32("query_level ", ps, depth, &(q_l->query_level )); prs_uint32("switch_value ", ps, depth, &(q_l->switch_value )); + + return True; } /******************************************************************* makes an NET_R_LOGON_CTRL2 structure. ********************************************************************/ -void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, +BOOL make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, uint32 flags, uint32 pdc_status, uint32 logon_attempts, uint32 tc_status, char *trusted_domain_name) { - if (r_l == NULL) return; + if (r_l == NULL) return False; DEBUG(5,("make_r_logon_ctrl2\n")); @@ -224,14 +240,16 @@ void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, break; } } + + return True; } /******************************************************************* reads or writes an NET_R_LOGON_CTRL2 structure. ********************************************************************/ -void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth) +BOOL net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth) { - if (r_l == NULL) return; + if (r_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_logon_ctrl2"); depth++; @@ -268,17 +286,19 @@ void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, i } prs_uint32("status ", ps, depth, &(r_l->status )); + + return True; } /******************************************************************* makes an NET_R_TRUST_DOM_LIST structure. ********************************************************************/ -void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, +BOOL make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, uint32 num_doms, char *dom_name) { int i = 0; - if (r_t == NULL) return; + if (r_t == NULL) return False; DEBUG(5,("make_r_trust_dom\n")); @@ -300,15 +320,17 @@ void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, } r_t->status = 0; + + return True; } /******************************************************************* reads or writes an NET_R_TRUST_DOM_LIST structure. ********************************************************************/ -void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth) +BOOL net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth) { int i; - if (r_t == NULL) return; + if (r_t == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_trust_dom"); depth++; @@ -320,15 +342,17 @@ void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, } prs_uint32("status", ps, depth, &(r_t->status)); + + return True; } /******************************************************************* reads or writes an NET_Q_TRUST_DOM_LIST structure. ********************************************************************/ -void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth) +BOOL net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth) { - if (q_l == NULL) return; + if (q_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_trust_dom"); depth++; @@ -339,16 +363,18 @@ void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, prs_align(ps); prs_uint32("function_code", ps, depth, &(q_l->function_code)); + + return True; } /******************************************************************* makes an NET_Q_REQ_CHAL structure. ********************************************************************/ -void make_q_req_chal(NET_Q_REQ_CHAL *q_c, +BOOL make_q_req_chal(NET_Q_REQ_CHAL *q_c, char *logon_srv, char *logon_clnt, DOM_CHAL *clnt_chal) { - if (q_c == NULL) return; + if (q_c == NULL) return False; DEBUG(5,("make_q_req_chal: %d\n", __LINE__)); @@ -360,15 +386,17 @@ void make_q_req_chal(NET_Q_REQ_CHAL *q_c, memcpy(q_c->clnt_chal.data, clnt_chal->data, sizeof(clnt_chal->data)); DEBUG(5,("make_q_req_chal: %d\n", __LINE__)); + + return True; } /******************************************************************* reads or writes an NET_Q_REQ_CHAL structure. ********************************************************************/ -void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth) +BOOL net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth) { int old_align; - if (q_c == NULL) return; + if (q_c == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_req_chal"); depth++; @@ -385,14 +413,16 @@ void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int dep /* client challenge is _not_ aligned after the unicode strings */ smb_io_chal("", &(q_c->clnt_chal), ps, depth); /* client challenge */ ps->align = old_align; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth) +BOOL net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth) { - if (r_c == NULL) return; + if (r_c == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_req_chal"); depth++; @@ -402,18 +432,20 @@ void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int dep smb_io_chal("", &(r_c->srv_chal), ps, depth); /* server challenge */ prs_uint32("status", ps, depth, &(r_c->status)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_q_auth_2(NET_Q_AUTH_2 *q_a, +BOOL make_q_auth_2(NET_Q_AUTH_2 *q_a, const char *logon_srv, const char *acct_name, uint16 sec_chan, const char *comp_name, DOM_CHAL *clnt_chal, uint32 clnt_flgs) { - if (q_a == NULL) return; + if (q_a == NULL) return False; DEBUG(5,("make_q_auth_2: %d\n", __LINE__)); @@ -422,15 +454,17 @@ void make_q_auth_2(NET_Q_AUTH_2 *q_a, q_a->clnt_flgs.neg_flags = clnt_flgs; DEBUG(5,("make_q_auth_2: %d\n", __LINE__)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth) +BOOL net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth) { int old_align; - if (q_a == NULL) return; + if (q_a == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_auth_2"); depth++; @@ -444,14 +478,16 @@ void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth) smb_io_chal ("", &(q_a->clnt_chal), ps, depth); /* client-calculated credentials */ ps->align = old_align; net_io_neg_flags("", &(q_a->clnt_flgs), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth) +BOOL net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth) { - if (r_a == NULL) return; + if (r_a == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_auth_2"); depth++; @@ -462,30 +498,34 @@ void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth) net_io_neg_flags("", &(r_a->srv_flgs), ps, depth); prs_uint32("status", ps, depth, &(r_a->status)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, +BOOL make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]) { - if (q_s == NULL || cred == NULL) return; + if (q_s == NULL || cred == NULL) return False; DEBUG(5,("make_q_srv_pwset\n")); make_clnt_info(&(q_s->clnt_id), logon_srv, acct_name, sec_chan, comp_name, cred); memcpy(q_s->pwd, nt_cypher, sizeof(q_s->pwd)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth) +BOOL net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth) { - if (q_s == NULL) return; + if (q_s == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_srv_pwset"); depth++; @@ -494,14 +534,16 @@ void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int d smb_io_clnt_info("", &(q_s->clnt_id), ps, depth); /* client identification/authentication info */ prs_uint8s (False, "pwd", ps, depth, q_s->pwd, 16); /* new password - undocumented */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth) +BOOL net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth) { - if (r_s == NULL) return; + if (r_s == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_srv_pwset"); depth++; @@ -511,6 +553,8 @@ void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int d smb_io_cred("", &(r_s->srv_cred), ps, depth); /* server challenge */ prs_uint32("status", ps, depth, &(r_s->status)); + + return True; } @@ -537,12 +581,14 @@ static int make_dom_sid2s(char *sids_str, DOM_SID2 *sids, int max_sids) } return count; + + return True; } /******************************************************************* makes a NET_ID_INFO_1 structure. ********************************************************************/ -void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, +BOOL make_id_info1(NET_ID_INFO_1 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, char *user_name, char *wksta_name, char sess_key[16], @@ -555,7 +601,7 @@ void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, unsigned char lm_owf[16]; unsigned char nt_owf[16]; - if (id == NULL) return; + if (id == NULL) return False; DEBUG(5,("make_id_info1: %d\n", __LINE__)); @@ -607,14 +653,16 @@ void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, make_unistr2(&(id->uni_domain_name), domain_name, len_domain_name); make_unistr2(&(id->uni_user_name ), user_name , len_user_name ); make_unistr2(&(id->uni_wksta_name ), wksta_name , len_wksta_name ); + + return True; } /******************************************************************* reads or writes an NET_ID_INFO_1 structure. ********************************************************************/ -static void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth) +static BOOL net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth) { - if (id == NULL) return; + if (id == NULL) return False; prs_debug(ps, depth, desc, "net_io_id_info1"); depth++; @@ -640,6 +688,8 @@ static void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int smb_io_unistr2("unistr2", &(id->uni_user_name ), id->hdr_user_name.buffer, ps, depth); smb_io_unistr2("unistr2", &(id->uni_wksta_name ), id->hdr_wksta_name.buffer, ps, depth); } + + return True; } /******************************************************************* @@ -657,7 +707,7 @@ checking for a logon as it doesn't export the password hashes to anyone who has compromised the secure channel. JRA. ********************************************************************/ -void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, +BOOL make_id_info2(NET_ID_INFO_2 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, char *user_name, char *wksta_name, unsigned char lm_challenge[8], @@ -672,7 +722,7 @@ void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, unsigned char lm_owf[24]; unsigned char nt_owf[24]; - if (id == NULL) return; + if (id == NULL) return False; DEBUG(5,("make_id_info2: %d\n", __LINE__)); @@ -710,14 +760,16 @@ void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, make_string2(&(id->nt_chal_resp ), (char *)nt_chal_resp , nt_chal_resp_len); make_string2(&(id->lm_chal_resp ), (char *)lm_chal_resp , lm_chal_resp_len); + + return True; } /******************************************************************* reads or writes an NET_ID_INFO_2 structure. ********************************************************************/ -static void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth) +static BOOL net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth) { - if (id == NULL) return; + if (id == NULL) return False; prs_debug(ps, depth, desc, "net_io_id_info2"); depth++; @@ -747,18 +799,20 @@ static void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int smb_io_string2("nt_chal_resp" , &(id->nt_chal_resp) , id->hdr_nt_chal_resp.buffer, ps, depth); smb_io_string2("lm_chal_resp" , &(id->lm_chal_resp) , id->hdr_lm_chal_resp.buffer, ps, depth); } + + return True; } /******************************************************************* makes a DOM_SAM_INFO structure. ********************************************************************/ -void make_sam_info(DOM_SAM_INFO *sam, +BOOL make_sam_info(DOM_SAM_INFO *sam, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, uint16 logon_level, NET_ID_INFO_CTR *ctr, uint16 validation_level) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_info: %d\n", __LINE__)); @@ -777,14 +831,16 @@ void make_sam_info(DOM_SAM_INFO *sam, sam->logon_level = logon_level; sam->ctr = ctr; sam->validation_level = validation_level; + + return True; } /******************************************************************* reads or writes a DOM_SAM_INFO structure. ********************************************************************/ -static void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth) +static BOOL net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "smb_io_sam_info"); depth++; @@ -812,14 +868,16 @@ static void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps break; } } + + return True; } /******************************************************************* reads or writes a DOM_SAM_INFO structure. ********************************************************************/ -static void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth) +static BOOL smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "smb_io_sam_info"); depth++; @@ -839,12 +897,14 @@ static void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int } prs_uint16("validation_level", ps, depth, &(sam->validation_level)); + + return True; } /************************************************************************* make_net_user_info3 *************************************************************************/ -void make_net_user_info3(NET_USER_INFO_3 *usr, +BOOL make_net_user_info3(NET_USER_INFO_3 *usr, NTTIME *logon_time, NTTIME *logoff_time, @@ -959,17 +1019,19 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, make_dom_sid2(&(usr->dom_sid), dom_sid); /* "other" sids are set up above */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth) +static BOOL net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth) { int i; - if (usr == NULL) return; + if (usr == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_lsa_user_info"); depth++; @@ -1041,14 +1103,16 @@ static void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, smb_io_dom_sid2("", &(usr->other_sids[i]), ps, depth); /* other domain SIDs */ } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth) +BOOL net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth) { - if (q_l == NULL) return; + if (q_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_sam_logon"); depth++; @@ -1056,14 +1120,16 @@ void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int d prs_align(ps); smb_io_sam_info("", &(q_l->sam_id), ps, depth); /* domain SID */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth) +BOOL net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth) { - if (r_l == NULL) return; + if (r_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_sam_logon"); depth++; @@ -1084,14 +1150,16 @@ void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int d prs_uint32("status ", ps, depth, &(r_l->status)); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth) +BOOL net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth) { - if (q_l == NULL) return; + if (q_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_sam_logoff"); depth++; @@ -1099,14 +1167,16 @@ void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int prs_align(ps); smb_io_sam_info("", &(q_l->sam_id), ps, depth); /* domain SID */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth) +BOOL net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth) { - if (r_l == NULL) return; + if (r_l == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_sam_logoff"); depth++; @@ -1117,15 +1187,17 @@ void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int smb_io_cred("", &(r_l->srv_creds), ps, depth); /* server credentials. server time stamp appears to be ignored. */ prs_uint32("status ", ps, depth, &(r_l->status)); + + return True; } /******************************************************************* makes a NET_Q_SAM_SYNC structure. ********************************************************************/ -void make_q_sam_sync(NET_Q_SAM_SYNC *q_s, char *srv_name, char *cli_name, +BOOL make_q_sam_sync(NET_Q_SAM_SYNC *q_s, char *srv_name, char *cli_name, DOM_CRED *cli_creds, uint32 database_id) { - if (q_s == NULL) return; + if (q_s == NULL) return False; DEBUG(5,("make_q_sam_sync\n")); @@ -1139,14 +1211,16 @@ void make_q_sam_sync(NET_Q_SAM_SYNC *q_s, char *srv_name, char *cli_name, q_s->restart_state = 0; q_s->sync_context = 0; q_s->max_size = 0xffff; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_q_sam_sync(char *desc, NET_Q_SAM_SYNC *q_s, prs_struct *ps, int depth) +BOOL net_io_q_sam_sync(char *desc, NET_Q_SAM_SYNC *q_s, prs_struct *ps, int depth) { - if (q_s == NULL) return; + if (q_s == NULL) return False; prs_debug(ps, depth, desc, "net_io_q_sam_sync"); depth++; @@ -1162,14 +1236,16 @@ void net_io_q_sam_sync(char *desc, NET_Q_SAM_SYNC *q_s, prs_struct *ps, int dept prs_uint32("sync_context ", ps, depth, &(q_s->sync_context )); prs_uint32("max_size", ps, depth, &(q_s->max_size)); + + return True; } /******************************************************************* makes a SAM_DELTA_HDR structure. ********************************************************************/ -void make_sam_delta_hdr(SAM_DELTA_HDR *delta, uint16 type, uint32 rid) +BOOL make_sam_delta_hdr(SAM_DELTA_HDR *delta, uint16 type, uint32 rid) { - if (delta == NULL) return; + if (delta == NULL) return False; DEBUG(5,("make_sam_delta_hdr\n")); @@ -1178,14 +1254,16 @@ void make_sam_delta_hdr(SAM_DELTA_HDR *delta, uint16 type, uint32 rid) delta->type3 = type; delta->ptr_delta = 1; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_delta_hdr(char *desc, SAM_DELTA_HDR *delta, prs_struct *ps, int depth) +static BOOL net_io_sam_delta_hdr(char *desc, SAM_DELTA_HDR *delta, prs_struct *ps, int depth) { - if (delta == NULL) return; + if (delta == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_delta_hdr"); depth++; @@ -1196,14 +1274,16 @@ static void net_io_sam_delta_hdr(char *desc, SAM_DELTA_HDR *delta, prs_struct *p prs_uint32("type3", ps, depth, &(delta->type3 )); prs_uint32("ptr_delta", ps, depth, &(delta->ptr_delta )); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_domain_info(char *desc, SAM_DOMAIN_INFO *info, prs_struct *ps, int depth) +static BOOL net_io_sam_domain_info(char *desc, SAM_DOMAIN_INFO *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_domain_info"); depth++; @@ -1232,14 +1312,16 @@ static void net_io_sam_domain_info(char *desc, SAM_DOMAIN_INFO *info, prs_struct info->hdr_sec_desc.buffer, ps, depth); smb_io_unistr2("buf_unknown" , &(info->buf_unknown ), info->hdr_unknown .buffer, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_group_info(char *desc, SAM_GROUP_INFO *info, prs_struct *ps, int depth) +static BOOL net_io_sam_group_info(char *desc, SAM_GROUP_INFO *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_group_info"); depth++; @@ -1256,12 +1338,14 @@ static void net_io_sam_group_info(char *desc, SAM_GROUP_INFO *info, prs_struct * info->hdr_grp_desc.buffer, ps, depth); smb_io_buffer4("buf_sec_desc", &(info->buf_sec_desc), info->hdr_sec_desc.buffer, ps, depth); + + return True; } /******************************************************************* makes a SAM_ACCOUNT_INFO structure. ********************************************************************/ -void make_sam_account_info(SAM_ACCOUNT_INFO *info, char *user_name, +BOOL make_sam_account_info(SAM_ACCOUNT_INFO *info, char *user_name, char *full_name, uint32 user_rid, uint32 group_rid, char *home_dir, char *dir_drive, char *logon_script, char *acct_desc, uint32 acb_info, char *profile) @@ -1320,15 +1404,17 @@ void make_sam_account_info(SAM_ACCOUNT_INFO *info, char *user_name, make_unistr2(&(info->uni_logon_script), logon_script, len_logon_script+1); make_unistr2(&(info->uni_acct_desc), acct_desc, len_acct_desc+1); make_unistr2(&(info->uni_profile ), profile , len_profile +1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_passwd_info(char *desc, SAM_PWD *pwd, +static BOOL net_io_sam_passwd_info(char *desc, SAM_PWD *pwd, prs_struct *ps, int depth) { - if (pwd == NULL) return; + if (pwd == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_passwd_info"); depth++; @@ -1343,18 +1429,20 @@ static void net_io_sam_passwd_info(char *desc, SAM_PWD *pwd, smb_io_unihdr("", &(pwd->hdr_empty_lm), ps, depth); smb_io_unihdr("", &(pwd->hdr_empty_nt), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_account_info(char *desc, uint8 sess_key[16], +static BOOL net_io_sam_account_info(char *desc, uint8 sess_key[16], SAM_ACCOUNT_INFO *info, prs_struct *ps, int depth) { BUFHDR2 hdr_priv_data; int i; - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_account_info"); depth++; @@ -1470,17 +1558,19 @@ static void net_io_sam_account_info(char *desc, uint8 sess_key[16], smb_io_unistr2("uni_profile" , &(info->uni_profile ), info->hdr_profile.buffer, ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_struct *ps, int depth) +static BOOL net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_struct *ps, int depth) { int i; fstring tmp; - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_group_mem_info"); depth++; @@ -1497,7 +1587,7 @@ static void net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_ if (info->num_members2 != info->num_members) { /* RPC fault */ - return; + return False; } SMB_ASSERT_ARRAY(info->rids, info->num_members2); @@ -1516,7 +1606,7 @@ static void net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_ if (info->num_members3 != info->num_members) { /* RPC fault */ - return; + return False; } SMB_ASSERT_ARRAY(info->attribs, info->num_members3); @@ -1528,14 +1618,16 @@ static void net_io_sam_group_mem_info(char *desc, SAM_GROUP_MEM_INFO *info, prs_ prs_uint32(tmp, ps, depth, &(info->attribs[i])); } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_alias_info(char *desc, SAM_ALIAS_INFO *info, prs_struct *ps, int depth) +static BOOL net_io_sam_alias_info(char *desc, SAM_ALIAS_INFO *info, prs_struct *ps, int depth) { - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_alias_info"); depth++; @@ -1552,17 +1644,19 @@ static void net_io_sam_alias_info(char *desc, SAM_ALIAS_INFO *info, prs_struct * info->hdr_sec_desc.buffer, ps, depth); smb_io_unistr2("uni_als_desc", &(info->uni_als_desc), info->hdr_als_name.buffer, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_alias_mem_info(char *desc, SAM_ALIAS_MEM_INFO *info, prs_struct *ps, int depth) +static BOOL net_io_sam_alias_mem_info(char *desc, SAM_ALIAS_MEM_INFO *info, prs_struct *ps, int depth) { int i; fstring tmp; - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_alias_mem_info"); depth++; @@ -1578,7 +1672,7 @@ static void net_io_sam_alias_mem_info(char *desc, SAM_ALIAS_MEM_INFO *info, prs_ if (info->num_sids != info->num_members) { /* RPC fault */ - return; + return False; } SMB_ASSERT_ARRAY(info->ptr_sids, info->num_sids); @@ -1602,16 +1696,18 @@ static void net_io_sam_alias_mem_info(char *desc, SAM_ALIAS_MEM_INFO *info, prs_ } } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void net_io_sam_delta_ctr(char *desc, uint8 sess_key[16], +static BOOL net_io_sam_delta_ctr(char *desc, uint8 sess_key[16], SAM_DELTA_CTR *delta, uint16 type, prs_struct *ps, int depth) { - if (delta == NULL) return; + if (delta == NULL) return False; prs_debug(ps, depth, desc, "net_io_sam_delta_ctr"); depth++; @@ -1661,17 +1757,19 @@ static void net_io_sam_delta_ctr(char *desc, uint8 sess_key[16], break; } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_r_sam_sync(char *desc, uint8 sess_key[16], +BOOL net_io_r_sam_sync(char *desc, uint8 sess_key[16], NET_R_SAM_SYNC *r_s, prs_struct *ps, int depth) { int i; - if (r_s == NULL) return; + if (r_s == NULL) return False; prs_debug(ps, depth, desc, "net_io_r_sam_sync"); depth++; @@ -1690,7 +1788,7 @@ void net_io_r_sam_sync(char *desc, uint8 sess_key[16], if (r_s->num_deltas2 != r_s->num_deltas) { /* RPC fault */ - return; + return False; } for (i = 0; i < r_s->num_deltas2; i++) @@ -1709,4 +1807,6 @@ void net_io_r_sam_sync(char *desc, uint8 sess_key[16], prs_align(ps); prs_uint32("status", ps, depth, &(r_s->status)); + + return True; } diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 4e007ce07c..f30a05e346 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -2,8 +2,8 @@ Unix SMB/Netbios implementation. Version 1.9. Samba memory buffer functions - Copyright (C) Andrew Tridgell 1992-1997 - Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Andrew Tridgell 1992-1999 + Copyright (C) Luke Kenneth Casson Leighton 1996-1999 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,7 +103,7 @@ BOOL prs_grow(prs_struct *ps) /******************************************************************* stream a uint8 ********************************************************************/ -BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8) +BOOL _prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8) { char *q = mem_data(&(ps->data), ps->offset); if (q == NULL) return False; @@ -117,7 +117,7 @@ BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8) /******************************************************************* stream a uint16 ********************************************************************/ -BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16) +BOOL _prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16) { char *q = mem_data(&(ps->data), ps->offset); if (q == NULL) return False; @@ -131,7 +131,7 @@ BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16) /******************************************************************* hash a stream. ********************************************************************/ -BOOL prs_hash1(prs_struct *ps, uint32 offset, uint8 sess_key[16]) +BOOL _prs_hash1(prs_struct *ps, uint32 offset, uint8 sess_key[16]) { char *q = mem_data(&(ps->data), offset); if (q == NULL) return False; @@ -152,7 +152,7 @@ BOOL prs_hash1(prs_struct *ps, uint32 offset, uint8 sess_key[16]) /******************************************************************* stream a uint32 ********************************************************************/ -BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32) +BOOL _prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32) { char *q = mem_data(&(ps->data), ps->offset); if (q == NULL) return False; @@ -167,7 +167,7 @@ BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32) /****************************************************************** stream an array of uint8s. length is number of uint8s ********************************************************************/ -BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len) +BOOL _prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + len * sizeof(uint8); @@ -184,7 +184,7 @@ BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *dat /****************************************************************** stream an array of uint16s. length is number of uint16s ********************************************************************/ -BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len) +BOOL _prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + len * sizeof(uint16); @@ -201,7 +201,7 @@ BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *d /****************************************************************** stream an array of uint32s. length is number of uint32s ********************************************************************/ -BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len) +BOOL _prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + len * sizeof(uint32); @@ -219,7 +219,7 @@ BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *d stream a "not" unicode string, length/buffer specified separately, in byte chars ********************************************************************/ -BOOL prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 *str) +BOOL _prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 *str) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + str->buf_len; @@ -237,7 +237,7 @@ BOOL prs_buffer2(BOOL charmode, char *name, prs_struct *ps, int depth, BUFFER2 * stream a string, length/buffer specified separately, in uint8 chars. ********************************************************************/ -BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str) +BOOL _prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + str->str_str_len * sizeof(uint8); @@ -255,7 +255,7 @@ BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 * stream a unicode string, length/buffer specified separately, in uint16 chars. ********************************************************************/ -BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str) +BOOL _prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + str->uni_str_len * sizeof(uint16); @@ -273,7 +273,7 @@ BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 * stream a unicode string, length/buffer specified separately, in uint16 chars. ********************************************************************/ -BOOL prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int depth) +BOOL _prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int depth) { char *q = mem_data(&(ps->data), ps->offset); int end_offset = ps->offset + str->uni_str_len * sizeof(uint16); @@ -290,7 +290,7 @@ BOOL prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int de /******************************************************************* stream a unicode null-terminated string ********************************************************************/ -BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str) +BOOL _prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str) { int i = -1; uint8 *start = (uint8*)mem_data(&(ps->data), ps->offset); @@ -322,7 +322,7 @@ BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str) (up to max size of pstring - 1024 chars). ********************************************************************/ -BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, uint16 max_buf_size) +BOOL _prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, uint16 max_buf_size) { uint8 *start = (uint8*)mem_data(&(ps->data), ps->offset); int i = -1; /* start off at zero after 1st i++ */ @@ -358,13 +358,13 @@ BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, ui prs_uint16 wrapper. call this and it sets up a pointer to where the uint16 should be stored, or gets the size if reading ********************************************************************/ -BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset) +BOOL _prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset) { (*offset) = ps->offset; if (ps->io) { /* reading. */ - return prs_uint16(name, ps, depth, data16); + return _prs_uint16(name, ps, depth, data16); } else { @@ -377,7 +377,7 @@ BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint3 prs_uint16 wrapper. call this and it retrospectively stores the size. does nothing on reading, as that is already handled by ...._pre() ********************************************************************/ -BOOL prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16, +BOOL _prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 ptr_uint16, uint32 start_offset) { if (!ps->io) @@ -401,13 +401,13 @@ BOOL prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16, prs_uint32 wrapper. call this and it sets up a pointer to where the uint32 should be stored, or gets the size if reading ********************************************************************/ -BOOL prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset) +BOOL _prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset) { (*offset) = ps->offset; if (ps->io) { /* reading. */ - return prs_uint32(name, ps, depth, data32); + return _prs_uint32(name, ps, depth, data32); } else { @@ -420,7 +420,7 @@ BOOL prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint3 prs_uint32 wrapper. call this and it retrospectively stores the size. does nothing on reading, as that is already handled by ...._pre() ********************************************************************/ -BOOL prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32, +BOOL _prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 ptr_uint32, uint32 data_size) { if (!ps->io) diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index a7e3c1d8be..e37fac16e9 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -2,9 +2,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,21 +30,23 @@ extern int DEBUGLEVEL; /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_open_hklm(REG_Q_OPEN_HKLM *q_o, +BOOL make_reg_q_open_hklm(REG_Q_OPEN_HKLM *q_o, uint16 unknown_0, uint32 level) { q_o->ptr = 1; q_o->unknown_0 = unknown_0; q_o->unknown_1 = 0x0; /* random - changes */ q_o->level = level; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_open_hklm(char *desc, REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_open_hklm(char *desc, REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_open_hklm"); depth++; @@ -58,15 +60,17 @@ void reg_io_q_open_hklm(char *desc, REG_Q_OPEN_HKLM *r_q, prs_struct *ps, int d prs_uint16("unknown_1", ps, depth, &(r_q->unknown_1)); prs_uint32("level ", ps, depth, &(r_q->level )); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_open_hklm(char *desc, REG_R_OPEN_HKLM *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_open_hklm(char *desc, REG_R_OPEN_HKLM *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_open_hklm"); depth++; @@ -76,23 +80,27 @@ void reg_io_r_open_hklm(char *desc, REG_R_OPEN_HKLM *r_r, prs_struct *ps, int d smb_io_pol_hnd("", &(r_r->pol), ps, depth); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_flush_key(REG_Q_FLUSH_KEY *q_u, POLICY_HND *pol) +BOOL make_reg_q_flush_key(REG_Q_FLUSH_KEY *q_u, POLICY_HND *pol) { memcpy(&(q_u->pol), pol, sizeof(q_u->pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_flush_key(char *desc, REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_flush_key(char *desc, REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_flush_key"); depth++; @@ -100,15 +108,17 @@ void reg_io_q_flush_key(char *desc, REG_Q_FLUSH_KEY *r_q, prs_struct *ps, int d prs_align(ps); smb_io_pol_hnd("", &(r_q->pol), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_flush_key(char *desc, REG_R_FLUSH_KEY *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_flush_key(char *desc, REG_R_FLUSH_KEY *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_flush_key"); depth++; @@ -116,12 +126,15 @@ void reg_io_r_flush_key(char *desc, REG_R_FLUSH_KEY *r_r, prs_struct *ps, int d prs_align(ps); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* reads or writes SEC_DESC_BUF and SEC_DATA structures. ********************************************************************/ -static void reg_io_hdrbuf_sec(uint32 ptr, uint32 *ptr3, BUFHDR *hdr_sec, SEC_DESC_BUF *data, prs_struct *ps, int depth) +static BOOL reg_io_hdrbuf_sec(uint32 ptr, uint32 *ptr3, BUFHDR *hdr_sec, + SEC_DESC_BUF *data, prs_struct *ps, int depth) { if (ptr != 0) { @@ -142,13 +155,15 @@ static void reg_io_hdrbuf_sec(uint32 ptr, uint32 *ptr3, BUFHDR *hdr_sec, SEC_DES ps->offset = old_offset + data->len + sizeof(uint32) * ((ptr3 != NULL) ? 5 : 3); prs_align(ps); } + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd, +BOOL make_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd, char *name, char *class, SEC_ACCESS *sam_access, SEC_DESC_BUF *sec_buf, @@ -180,14 +195,16 @@ void make_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd, make_sec_desc_buf(q_c->data, sec_len, sec); q_c->unknown_2 = 0x00000000; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_create_key(char *desc, REG_Q_CREATE_KEY *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_create_key(char *desc, REG_Q_CREATE_KEY *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_create_key"); depth++; @@ -217,15 +234,17 @@ void reg_io_q_create_key(char *desc, REG_Q_CREATE_KEY *r_q, prs_struct *ps, int reg_io_hdrbuf_sec(r_q->ptr2, &r_q->ptr3, &r_q->hdr_sec, r_q->data, ps, depth); prs_uint32("unknown_2", ps, depth, &(r_q->unknown_2)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_create_key(char *desc, REG_R_CREATE_KEY *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_create_key(char *desc, REG_R_CREATE_KEY *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_create_key"); depth++; @@ -236,13 +255,15 @@ void reg_io_r_create_key(char *desc, REG_R_CREATE_KEY *r_r, prs_struct *ps, int prs_uint32("unknown", ps, depth, &(r_r->unknown)); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd, +BOOL make_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd, char *name) { int len_name = name != NULL ? strlen(name ) + 1: 0; @@ -252,14 +273,16 @@ void make_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd, make_uni_hdr(&(q_c->hdr_name), len_name); make_unistr2(&(q_c->uni_name), name, len_name); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_delete_val(char *desc, REG_Q_DELETE_VALUE *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_delete_val(char *desc, REG_Q_DELETE_VALUE *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_delete_val"); depth++; @@ -271,15 +294,17 @@ void reg_io_q_delete_val(char *desc, REG_Q_DELETE_VALUE *r_q, prs_struct *ps, i smb_io_unihdr ("", &(r_q->hdr_name), ps, depth); smb_io_unistr2("", &(r_q->uni_name), r_q->hdr_name.buffer, ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_delete_val(char *desc, REG_R_DELETE_VALUE *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_delete_val(char *desc, REG_R_DELETE_VALUE *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_delete_val"); depth++; @@ -287,13 +312,15 @@ void reg_io_r_delete_val(char *desc, REG_R_DELETE_VALUE *r_r, prs_struct *ps, i prs_align(ps); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd, +BOOL make_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd, char *name) { int len_name = name != NULL ? strlen(name ) + 1: 0; @@ -303,14 +330,16 @@ void make_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd, make_uni_hdr(&(q_c->hdr_name), len_name); make_unistr2(&(q_c->uni_name), name, len_name); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_delete_key(char *desc, REG_Q_DELETE_KEY *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_delete_key(char *desc, REG_Q_DELETE_KEY *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_delete_key"); depth++; @@ -322,15 +351,17 @@ void reg_io_q_delete_key(char *desc, REG_Q_DELETE_KEY *r_q, prs_struct *ps, int smb_io_unihdr ("", &(r_q->hdr_name), ps, depth); smb_io_unistr2("", &(r_q->uni_name), r_q->hdr_name.buffer, ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_delete_key(char *desc, REG_R_DELETE_KEY *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_delete_key(char *desc, REG_R_DELETE_KEY *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_delete_key"); depth++; @@ -338,13 +369,15 @@ void reg_io_r_delete_key(char *desc, REG_R_DELETE_KEY *r_r, prs_struct *ps, int prs_align(ps); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd, +BOOL make_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd, uint32 max_class_len) { ZERO_STRUCTP(q_o); @@ -354,14 +387,16 @@ void make_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd, q_o->hdr_class.uni_max_len = max_class_len * 2; q_o->hdr_class.buffer = max_class_len > 0 ? 1 : 0; q_o->uni_class.uni_max_len = max_class_len; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_query_key(char *desc, REG_Q_QUERY_KEY *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_query_key(char *desc, REG_Q_QUERY_KEY *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_query_key"); depth++; @@ -373,15 +408,17 @@ void reg_io_q_query_key(char *desc, REG_Q_QUERY_KEY *r_q, prs_struct *ps, int d smb_io_unistr2("", &(r_q->uni_class), r_q->hdr_class.buffer, ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_query_key(char *desc, REG_R_QUERY_KEY *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_query_key(char *desc, REG_R_QUERY_KEY *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_query_key"); depth++; @@ -403,23 +440,27 @@ void reg_io_r_query_key(char *desc, REG_R_QUERY_KEY *r_r, prs_struct *ps, int d smb_io_time("mod_time ", &(r_r->mod_time), ps, depth); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_unk_1a(REG_Q_UNK_1A *q_o, POLICY_HND *hnd) +BOOL make_reg_q_unk_1a(REG_Q_UNK_1A *q_o, POLICY_HND *hnd) { memcpy(&(q_o->pol), hnd, sizeof(q_o->pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_unk_1a(char *desc, REG_Q_UNK_1A *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_unk_1a(char *desc, REG_Q_UNK_1A *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_unk_1a"); depth++; @@ -427,15 +468,17 @@ void reg_io_q_unk_1a(char *desc, REG_Q_UNK_1A *r_q, prs_struct *ps, int depth) prs_align(ps); smb_io_pol_hnd("", &(r_q->pol), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_unk_1a(char *desc, REG_R_UNK_1A *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_unk_1a(char *desc, REG_R_UNK_1A *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_unk_1a"); depth++; @@ -444,27 +487,31 @@ void reg_io_r_unk_1a(char *desc, REG_R_UNK_1A *r_r, prs_struct *ps, int depth) prs_uint32("unknown", ps, depth, &(r_r->unknown)); prs_uint32("status" , ps, depth, &(r_r->status )); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_q_open_hku(REG_Q_OPEN_HKU *q_o, +BOOL make_reg_q_open_hku(REG_Q_OPEN_HKU *q_o, uint16 unknown_0, uint32 level) { q_o->ptr = 1; q_o->unknown_0 = unknown_0; q_o->unknown_1 = 0x0; /* random - changes */ q_o->level = level; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_open_hku(char *desc, REG_Q_OPEN_HKU *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_open_hku(char *desc, REG_Q_OPEN_HKU *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_open_hku"); depth++; @@ -478,15 +525,17 @@ void reg_io_q_open_hku(char *desc, REG_Q_OPEN_HKU *r_q, prs_struct *ps, int dep prs_uint16("unknown_1", ps, depth, &(r_q->unknown_1)); prs_uint32("level ", ps, depth, &(r_q->level )); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_open_hku(char *desc, REG_R_OPEN_HKU *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_open_hku(char *desc, REG_R_OPEN_HKU *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_open_hku"); depth++; @@ -496,27 +545,31 @@ void reg_io_r_open_hku(char *desc, REG_R_OPEN_HKU *r_r, prs_struct *ps, int dep smb_io_pol_hnd("", &(r_r->pol), ps, depth); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* makes an REG_Q_CLOSE structure. ********************************************************************/ -void make_reg_q_close(REG_Q_CLOSE *q_c, POLICY_HND *hnd) +BOOL make_reg_q_close(REG_Q_CLOSE *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_reg_q_close\n")); memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth) +BOOL reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_close"); depth++; @@ -525,14 +578,16 @@ void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth) smb_io_pol_hnd("", &(q_u->pol), ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth) +BOOL reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_close"); depth++; @@ -543,15 +598,17 @@ void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth) prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol, +BOOL make_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol, uint32 buf_len, SEC_DESC *sec_desc) { - if (q_i == NULL) return; + if (q_i == NULL) return False; memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); @@ -560,14 +617,16 @@ void make_reg_q_set_key_sec(REG_Q_SET_KEY_SEC *q_i, POLICY_HND *pol, q_i->ptr = 1; make_buf_hdr(&(q_i->hdr_sec), buf_len, buf_len); make_sec_desc_buf(q_i->data, buf_len, sec_desc); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_set_key_sec(char *desc, REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_set_key_sec(char *desc, REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_set_key_sec"); depth++; @@ -580,14 +639,16 @@ void reg_io_q_set_key_sec(char *desc, REG_Q_SET_KEY_SEC *r_q, prs_struct *ps, i prs_uint32("ptr ", ps, depth, &(r_q->ptr )); reg_io_hdrbuf_sec(r_q->ptr, NULL, &r_q->hdr_sec, r_q->data, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, int depth) +BOOL reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_set_key_sec"); depth++; @@ -595,16 +656,18 @@ void reg_io_r_set_key_sec(char *desc, REG_R_SET_KEY_SEC *r_q, prs_struct *ps, in prs_align(ps); prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol, +BOOL make_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol, uint32 buf_len, SEC_DESC_BUF *sec_buf) { - if (q_i == NULL) return; + if (q_i == NULL) return False; memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); @@ -620,14 +683,16 @@ void make_reg_q_get_key_sec(REG_Q_GET_KEY_SEC *q_i, POLICY_HND *pol, make_buf_hdr(&(q_i->hdr_sec), buf_len, 0); make_sec_desc_buf(q_i->data, buf_len, NULL); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_get_key_sec(char *desc, REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_get_key_sec(char *desc, REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_get_key_sec"); depth++; @@ -640,6 +705,8 @@ void reg_io_q_get_key_sec(char *desc, REG_Q_GET_KEY_SEC *r_q, prs_struct *ps, i prs_uint32("ptr ", ps, depth, &(r_q->ptr )); reg_io_hdrbuf_sec(r_q->ptr, NULL, &r_q->hdr_sec, r_q->data, ps, depth); + + return True; } #if 0 @@ -650,22 +717,24 @@ makes a structure. uint32 buf_len, uint8 *buf, uint32 status) { - if (r_i == NULL) return; + if (r_i == NULL) return False; r_i->ptr = 1; make_buf_hdr(&(r_i->hdr_sec), buf_len, buf_len); make_sec_desc_buf(r_i->data, buf_len, 1); r_i->status = status; /* 0x0000 0000 or 0x0000 007a */ + + return True; } #endif /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_get_key_sec(char *desc, REG_R_GET_KEY_SEC *r_q, prs_struct *ps, int depth) +BOOL reg_io_r_get_key_sec(char *desc, REG_R_GET_KEY_SEC *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_get_key_sec"); depth++; @@ -683,18 +752,20 @@ void reg_io_r_get_key_sec(char *desc, REG_R_GET_KEY_SEC *r_q, prs_struct *ps, i } prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char *product_type, +BOOL make_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char *product_type, time_t unix_time, uint8 major, uint8 minor) { int len_type = strlen(product_type); - if (q_i == NULL) return; + if (q_i == NULL) return False; memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); @@ -714,14 +785,16 @@ void make_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char *product_type, q_i->ptr3 = 1; q_i->unknown = 0x00000000; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_info"); depth++; @@ -759,19 +832,21 @@ void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth) { prs_uint32("unknown", ps, depth, &(r_q->unknown)); } + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_r_info(REG_R_INFO *r_r, +BOOL make_reg_r_info(REG_R_INFO *r_r, uint32 level, char *os_type, uint32 status) { int len; - if (r_r == NULL || os_type == NULL) return; + if (r_r == NULL || os_type == NULL) return False; len = strlen(os_type); @@ -785,14 +860,16 @@ void make_reg_r_info(REG_R_INFO *r_r, r_r->unknown_0 = r_r->unknown_1 = len * 2; r_r->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_info"); depth++; @@ -825,16 +902,18 @@ void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth) } prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol, +BOOL make_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol, uint32 val_idx, uint32 max_val_len, uint32 max_buf_len) { - if (q_i == NULL) return; + if (q_i == NULL) return False; ZERO_STRUCTP(q_i); @@ -857,14 +936,16 @@ void make_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol, q_i->ptr2 = 1; q_i->len_value2 = 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_enum_val(char *desc, REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int depth) +BOOL reg_io_q_enum_val(char *desc, REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_enum_val"); depth++; @@ -899,14 +980,16 @@ void reg_io_q_enum_val(char *desc, REG_Q_ENUM_VALUE *q_q, prs_struct *ps, int d { prs_uint32("len_value2", ps, depth, &(q_q->len_value2)); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_enum_val(char *desc, REG_R_ENUM_VALUE *r_q, prs_struct *ps, int depth) +BOOL reg_io_r_enum_val(char *desc, REG_R_ENUM_VALUE *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_enum_val"); depth++; @@ -941,18 +1024,20 @@ void reg_io_r_enum_val(char *desc, REG_R_ENUM_VALUE *r_q, prs_struct *ps, int d } prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol, +BOOL make_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol, char *val_name, uint32 type, BUFFER3 *val) { int val_len = strlen(val_name) + 1; - if (q_i == NULL) return; + if (q_i == NULL) return False; ZERO_STRUCTP(q_i); @@ -963,14 +1048,16 @@ void make_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol, q_i->type = type; q_i->buf_value = val; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_create_val(char *desc, REG_Q_CREATE_VALUE *q_q, prs_struct *ps, int depth) +BOOL reg_io_q_create_val(char *desc, REG_Q_CREATE_VALUE *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_create_val"); depth++; @@ -986,14 +1073,16 @@ void reg_io_q_create_val(char *desc, REG_Q_CREATE_VALUE *q_q, prs_struct *ps, i prs_uint32("type", ps, depth, &(q_q->type)); smb_io_buffer3("buf_value", q_q->buf_value, ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_create_val(char *desc, REG_R_CREATE_VALUE *r_q, prs_struct *ps, int depth) +BOOL reg_io_r_create_val(char *desc, REG_R_CREATE_VALUE *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_create_val"); depth++; @@ -1001,14 +1090,16 @@ void reg_io_r_create_val(char *desc, REG_R_CREATE_VALUE *r_q, prs_struct *ps, i prs_align(ps); prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx) +BOOL make_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx) { - if (q_i == NULL) return; + if (q_i == NULL) return False; memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); @@ -1025,14 +1116,16 @@ void make_reg_q_enum_key(REG_Q_ENUM_KEY *q_i, POLICY_HND *pol, uint32 key_idx) q_i->ptr3 = 1; init_nt_time(&(q_i->time)); /* ignored ? */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_enum_key(char *desc, REG_Q_ENUM_KEY *q_q, prs_struct *ps, int depth) +BOOL reg_io_q_enum_key(char *desc, REG_Q_ENUM_KEY *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_enum_key"); depth++; @@ -1066,14 +1159,16 @@ void reg_io_q_enum_key(char *desc, REG_Q_ENUM_KEY *q_q, prs_struct *ps, int dep { smb_io_time("", &(q_q->time), ps, depth); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_enum_key(char *desc, REG_R_ENUM_KEY *r_q, prs_struct *ps, int depth) +BOOL reg_io_r_enum_key(char *desc, REG_R_ENUM_KEY *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_enum_key"); depth++; @@ -1108,18 +1203,20 @@ void reg_io_r_enum_key(char *desc, REG_R_ENUM_KEY *r_q, prs_struct *ps, int dep } prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol, +BOOL make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol, char *key_name, uint32 unk) { int len_name = strlen(key_name)+1; - if (r_q == NULL) return; + if (r_q == NULL) return False; memcpy(&(r_q->pol), pol, sizeof(r_q->pol)); @@ -1128,14 +1225,16 @@ void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol, r_q->unknown_0 = 0x00000000; r_q->unknown_1 = unk; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth) +BOOL reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_entry"); depth++; @@ -1150,27 +1249,31 @@ void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int prs_uint32("unknown_0", ps, depth, &(r_q->unknown_0)); prs_uint32("unknown_1", ps, depth, &(r_q->unknown_1)); + + return True; } /******************************************************************* creates a structure. ********************************************************************/ -void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, +BOOL make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, POLICY_HND *pol, uint32 status) { - if (r_r == NULL) return; + if (r_r == NULL) return False; memcpy(&(r_r->pol), pol, sizeof(r_r->pol)); r_r->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth) +BOOL reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth) { - if (r_r == NULL) return; + if (r_r == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_open_entry"); depth++; @@ -1180,17 +1283,19 @@ void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int smb_io_pol_hnd("", &(r_r->pol), ps, depth); prs_uint32("status", ps, depth, &(r_r->status)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_reg_q_shutdown(REG_Q_SHUTDOWN *q_i, +BOOL make_reg_q_shutdown(REG_Q_SHUTDOWN *q_i, char *msg, uint32 timeout, uint16 flags) { int len = strlen(msg) + 1; - if (q_i == NULL) return; + if (q_i == NULL) return False; ZERO_STRUCTP(q_i); @@ -1203,14 +1308,16 @@ void make_reg_q_shutdown(REG_Q_SHUTDOWN *q_i, q_i->timeout = timeout; q_i->flags = flags; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_q_shutdown(char *desc, REG_Q_SHUTDOWN *q_q, prs_struct *ps, int depth) +BOOL reg_io_q_shutdown(char *desc, REG_Q_SHUTDOWN *q_q, prs_struct *ps, int depth) { - if (q_q == NULL) return; + if (q_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_q_shutdown"); depth++; @@ -1228,14 +1335,16 @@ void reg_io_q_shutdown(char *desc, REG_Q_SHUTDOWN *q_q, prs_struct *ps, int dep prs_uint32("timeout", ps, depth, &(q_q->timeout)); prs_uint16("flags ", ps, depth, &(q_q->flags )); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void reg_io_r_shutdown(char *desc, REG_R_SHUTDOWN *r_q, prs_struct *ps, int depth) +BOOL reg_io_r_shutdown(char *desc, REG_R_SHUTDOWN *r_q, prs_struct *ps, int depth) { - if (r_q == NULL) return; + if (r_q == NULL) return False; prs_debug(ps, depth, desc, "reg_io_r_shutdown"); depth++; @@ -1243,5 +1352,7 @@ void reg_io_r_shutdown(char *desc, REG_R_SHUTDOWN *r_q, prs_struct *ps, int dep prs_align(ps); prs_uint32("status", ps, depth, &(r_q->status)); + + return True; } diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index 19cb4dfa4b..b902ee1414 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -3,9 +3,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -181,10 +181,10 @@ struct pipe_id_info pipe_names [] = /******************************************************************* creates an RPC_HDR structure. ********************************************************************/ -void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, +BOOL make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, uint32 call_id, int data_len, int auth_len) { - if (hdr == NULL) return; + if (hdr == NULL) return False; hdr->major = 5; /* RPC version 5 */ hdr->minor = 0; /* minor version 0 */ @@ -194,14 +194,16 @@ void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, hdr->frag_len = data_len; /* fragment length, fill in later */ hdr->auth_len = auth_len; /* authentication length */ hdr->call_id = call_id; /* call identifier - match incoming RPC */ + + return True; } /******************************************************************* reads or writes an RPC_HDR structure. ********************************************************************/ -void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth) { - if (rpc == NULL) return; + if (rpc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr"); depth++; @@ -214,14 +216,16 @@ void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth) prs_uint16("frag_len ", ps, depth, &(rpc->frag_len)); prs_uint16("auth_len ", ps, depth, &(rpc->auth_len)); prs_uint32("call_id ", ps, depth, &(rpc->call_id)); + + return True; } /******************************************************************* reads or writes an RPC_IFACE structure. ********************************************************************/ -static void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth) +static BOOL smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth) { - if (ifc == NULL) return; + if (ifc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_iface"); depth++; @@ -230,6 +234,8 @@ static void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int de prs_uint8s (False, "data ", ps, depth, ifc->data, sizeof(ifc->data)); prs_uint32 ( "version", ps, depth, &(ifc->version)); + + return True; } /******************************************************************* @@ -237,9 +243,9 @@ creates an RPC_ADDR_STR structure. The name can be null (RPC Alter-Context) ********************************************************************/ -static void make_rpc_addr_str(RPC_ADDR_STR *str, char *name) +static BOOL make_rpc_addr_str(RPC_ADDR_STR *str, char *name) { - if (str == NULL ) return; + if (str == NULL ) return False; if (name == NULL) { str->len = 1; @@ -250,14 +256,16 @@ static void make_rpc_addr_str(RPC_ADDR_STR *str, char *name) str->len = strlen(name) + 1; fstrcpy(str->str, name); } + + return True; } /******************************************************************* reads or writes an RPC_ADDR_STR structure. ********************************************************************/ -static void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth) +static BOOL smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth) { - if (str == NULL) return; + if (str == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_addr_str"); depth++; @@ -265,26 +273,30 @@ static void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, prs_uint16 ( "len", ps, depth, &(str->len)); prs_uint8s (True, "str", ps, depth, (uchar*)str->str, str->len); + + return True; } /******************************************************************* creates an RPC_HDR_BBA structure. ********************************************************************/ -static void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid) +static BOOL make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid) { - if (bba == NULL) return; + if (bba == NULL) return False; bba->max_tsize = max_tsize; /* maximum transmission fragment size (0x1630) */ bba->max_rsize = max_rsize; /* max receive fragment size (0x1630) */ bba->assoc_gid = assoc_gid; /* associated group id (0x0) */ + + return True; } /******************************************************************* reads or writes an RPC_HDR_BBA structure. ********************************************************************/ -static void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth) +static BOOL smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth) { - if (rpc == NULL) return; + if (rpc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_bba"); depth++; @@ -292,17 +304,19 @@ static void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, in prs_uint16("max_tsize", ps, depth, &(rpc->max_tsize)); prs_uint16("max_rsize", ps, depth, &(rpc->max_rsize)); prs_uint32("assoc_gid", ps, depth, &(rpc->assoc_gid)); + + return True; } /******************************************************************* creates an RPC_HDR_RB structure. ********************************************************************/ -void make_rpc_hdr_rb(RPC_HDR_RB *rpc, +BOOL make_rpc_hdr_rb(RPC_HDR_RB *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, uint32 num_elements, uint16 context_id, uint8 num_syntaxes, RPC_IFACE *abstract, RPC_IFACE *transfer) { - if (rpc == NULL) return; + if (rpc == NULL) return False; make_rpc_hdr_bba(&(rpc->bba), max_tsize, max_rsize, assoc_gid); @@ -315,14 +329,16 @@ void make_rpc_hdr_rb(RPC_HDR_RB *rpc, /* num and vers. of interface to use for replies */ memcpy(&(rpc->transfer), transfer, sizeof(rpc->transfer)); + + return True; } /******************************************************************* reads or writes an RPC_HDR_RB structure. ********************************************************************/ -void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth) { - if (rpc == NULL) return; + if (rpc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_rb"); depth++; @@ -335,6 +351,8 @@ void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth) smb_io_rpc_iface("", &(rpc->abstract), ps, depth); smb_io_rpc_iface("", &(rpc->transfer), ps, depth); + + return True; } /******************************************************************* @@ -343,14 +361,16 @@ creates an RPC_RESULTS structure. lkclXXXX only one reason at the moment! ********************************************************************/ -static void make_rpc_results(RPC_RESULTS *res, +static BOOL make_rpc_results(RPC_RESULTS *res, uint8 num_results, uint16 result, uint16 reason) { - if (res == NULL) return; + if (res == NULL) return False; res->num_results = num_results; /* the number of results (0x01) */ res->result = result ; /* result (0x00 = accept) */ res->reason = reason ; /* reason (0x00 = no reason specified) */ + + return True; } /******************************************************************* @@ -359,9 +379,9 @@ reads or writes an RPC_RESULTS structure. lkclXXXX only one reason at the moment! ********************************************************************/ -static void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth) +static BOOL smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth) { - if (res == NULL) return; + if (res == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_results"); depth++; @@ -374,6 +394,8 @@ static void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, in prs_uint16("result ", ps, depth, &(res->result )); prs_uint16("reason ", ps, depth, &(res->reason )); + + return True; } /******************************************************************* @@ -383,13 +405,13 @@ lkclXXXX only one reason at the moment! jfm: nope two ! The pipe_addr can be NULL ! ********************************************************************/ -void make_rpc_hdr_ba(RPC_HDR_BA *rpc, +BOOL make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, char *pipe_addr, uint8 num_results, uint16 result, uint16 reason, RPC_IFACE *transfer) { - if (rpc == NULL || transfer == NULL) return; + if (rpc == NULL || transfer == NULL) return False; make_rpc_hdr_bba (&(rpc->bba ), max_tsize, max_rsize, assoc_gid); make_rpc_addr_str(&(rpc->addr), pipe_addr); @@ -397,14 +419,16 @@ void make_rpc_hdr_ba(RPC_HDR_BA *rpc, /* the transfer syntax from the request */ memcpy(&(rpc->transfer), transfer, sizeof(rpc->transfer)); + + return True; } /******************************************************************* reads or writes an RPC_HDR_BA structure. ********************************************************************/ -void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth) { - if (rpc == NULL) return; + if (rpc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_ba"); depth++; @@ -413,26 +437,30 @@ void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth) smb_io_rpc_addr_str("", &(rpc->addr) , ps, depth); smb_io_rpc_results ("", &(rpc->res) , ps, depth); smb_io_rpc_iface ("", &(rpc->transfer), ps, depth); + + return True; } /******************************************************************* creates an RPC_HDR_REQ structure. ********************************************************************/ -void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum) +BOOL make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum) { - if (hdr == NULL) return; + if (hdr == NULL) return False; hdr->alloc_hint = alloc_hint; /* allocation hint */ hdr->context_id = 0; /* presentation context identifier */ hdr->opnum = opnum; /* opnum */ + + return True; } /******************************************************************* reads or writes an RPC_HDR_REQ structure. ********************************************************************/ -void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth) { - if (rpc == NULL) return; + if (rpc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_req"); depth++; @@ -440,14 +468,16 @@ void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth prs_uint32("alloc_hint", ps, depth, &(rpc->alloc_hint)); prs_uint16("context_id", ps, depth, &(rpc->context_id)); prs_uint16("opnum ", ps, depth, &(rpc->opnum)); + + return True; } /******************************************************************* reads or writes an RPC_HDR_RESP structure. ********************************************************************/ -void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth) { - if (rpc == NULL) return; + if (rpc == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_resp"); depth++; @@ -456,17 +486,19 @@ void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int dep prs_uint16("context_id", ps, depth, &(rpc->context_id)); prs_uint8 ("cancel_ct ", ps, depth, &(rpc->cancel_count)); prs_uint8 ("reserved ", ps, depth, &(rpc->reserved)); + + return True; } /******************************************************************* creates an RPC_HDR_AUTHA structure. ********************************************************************/ -void make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, +BOOL make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, uint16 max_tsize, uint16 max_rsize, uint8 auth_type, uint8 auth_level, uint8 stub_type_len) { - if (rai == NULL) return; + if (rai == NULL) return False; rai->max_tsize = max_tsize; /* maximum transmission fragment size (0x1630) */ rai->max_rsize = max_rsize; /* max receive fragment size (0x1630) */ @@ -477,14 +509,16 @@ void make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, rai->padding = 0; /* padding 0x00 */ rai->unknown = 0x0014a0c0; /* non-zero pointer to something */ + + return True; } /******************************************************************* reads or writes an RPC_HDR_AUTHA structure. ********************************************************************/ -void smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth) { - if (rai == NULL) return; + if (rai == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_autha"); depth++; @@ -498,6 +532,8 @@ void smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int de prs_uint8 ("padding ", ps, depth, &(rai->padding )); prs_uint32("unknown ", ps, depth, &(rai->unknown )); /* 0x0014a0c0 */ + + return True; } /******************************************************************* @@ -507,17 +543,19 @@ BOOL rpc_hdr_auth_chk(RPC_HDR_AUTH *rai) { return ((rai->auth_type == 0x0a || rai->auth_type == 0x44) && rai->auth_level == 0x06); + + return True; } /******************************************************************* creates an RPC_HDR_AUTH structure. ********************************************************************/ -void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, +BOOL make_rpc_hdr_auth(RPC_HDR_AUTH *rai, uint8 auth_type, uint8 auth_level, uint8 stub_type_len, uint32 ptr) { - if (rai == NULL) return; + if (rai == NULL) return False; rai->auth_type = auth_type; /* nt lm ssp 0x0a */ rai->auth_level = auth_level; /* 0x06 */ @@ -525,14 +563,16 @@ void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, rai->padding = 0; /* padding 0x00 */ rai->unknown = ptr; /* non-zero pointer to something */ + + return True; } /******************************************************************* reads or writes an RPC_HDR_AUTH structure. ********************************************************************/ -void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth) +BOOL smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth) { - if (rai == NULL) return; + if (rai == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_hdr_auth"); depth++; @@ -543,6 +583,8 @@ void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int dept prs_uint8 ("padding ", ps, depth, &(rai->padding )); prs_uint32("unknown ", ps, depth, &(rai->unknown )); /* 0x0014a0c0 */ + + return True; } /******************************************************************* @@ -552,45 +594,51 @@ BOOL rpc_auth_ntlmssp_verifier_chk(RPC_AUTH_NTLMSSP_VERIFIER *rav, char *signature, uint32 msg_type) { return (strequal(rav->signature, signature) && rav->msg_type == msg_type); + + return True; } /******************************************************************* creates an RPC_AUTH_NTLMSSP_VERIFIER structure. ********************************************************************/ -void make_rpc_auth_ntlmssp_verifier(RPC_AUTH_NTLMSSP_VERIFIER *rav, +BOOL make_rpc_auth_ntlmssp_verifier(RPC_AUTH_NTLMSSP_VERIFIER *rav, char *signature, uint32 msg_type) { - if (rav == NULL) return; + if (rav == NULL) return False; fstrcpy(rav->signature, signature); /* "NTLMSSP" */ rav->msg_type = msg_type; /* NTLMSSP_MESSAGE_TYPE */ + + return True; } /******************************************************************* reads or writes an RPC_AUTH_NTLMSSP_VERIFIER structure. ********************************************************************/ -void smb_io_rpc_auth_ntlmssp_verifier(char *desc, RPC_AUTH_NTLMSSP_VERIFIER *rav, prs_struct *ps, int depth) +BOOL smb_io_rpc_auth_ntlmssp_verifier(char *desc, RPC_AUTH_NTLMSSP_VERIFIER *rav, prs_struct *ps, int depth) { - if (rav == NULL) return; + if (rav == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_auth_verifier"); depth++; prs_string("signature", ps, depth, rav->signature, 0, sizeof(rav->signature)); /* "NTLMSSP" */ prs_uint32("msg_type ", ps, depth, &(rav->msg_type )); /* NTLMSSP_MESSAGE_TYPE */ + + return True; } /******************************************************************* creates an RPC_AUTH_NTLMSSP_NEG structure. ********************************************************************/ -void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, +BOOL make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, uint32 neg_flgs, fstring myname, fstring domain) { int len_myname = strlen(myname); int len_domain = strlen(domain); - if (neg == NULL) return; + if (neg == NULL) return False; neg->neg_flgs = neg_flgs ; /* 0x00b2b3 */ @@ -599,6 +647,8 @@ void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, fstrcpy(neg->myname, myname); fstrcpy(neg->domain, domain); + + return True; } /******************************************************************* @@ -607,9 +657,9 @@ reads or writes an RPC_AUTH_NTLMSSP_NEG structure. *** lkclXXXX HACK ALERT! *** ********************************************************************/ -void smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth) +BOOL smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth) { - if (neg == NULL) return; + if (neg == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_auth_ntlmssp_neg"); depth++; @@ -648,16 +698,18 @@ void smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_stru prs_uint8s(True , "myname", ps, depth, (uint8*)neg->myname , MIN(neg->hdr_myname .str_str_len, sizeof(neg->myname ))); prs_uint8s(True , "domain", ps, depth, (uint8*)neg->domain , MIN(neg->hdr_domain .str_str_len, sizeof(neg->domain ))); } + + return True; } /******************************************************************* creates an RPC_AUTH_NTLMSSP_CHAL structure. ********************************************************************/ -void make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl, +BOOL make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl, uint32 neg_flags, uint8 challenge[8]) { - if (chl == NULL) return; + if (chl == NULL) return False; chl->unknown_1 = 0x0; chl->unknown_2 = 0x00000028; @@ -665,14 +717,16 @@ void make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl, memcpy(chl->challenge, challenge, sizeof(chl->challenge)); bzero (chl->reserved , sizeof(chl->reserved)); + + return True; } /******************************************************************* reads or writes an RPC_AUTH_NTLMSSP_CHAL structure. ********************************************************************/ -void smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_struct *ps, int depth) +BOOL smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_struct *ps, int depth) { - if (chl == NULL) return; + if (chl == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_auth_ntlmssp_chal"); depth++; @@ -683,6 +737,8 @@ void smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_st prs_uint8s (False, "challenge", ps, depth, chl->challenge, sizeof(chl->challenge)); prs_uint8s (False, "reserved ", ps, depth, chl->reserved , sizeof(chl->reserved )); + + return True; } /******************************************************************* @@ -692,7 +748,7 @@ creates an RPC_AUTH_NTLMSSP_RESP structure. *** lkclXXXX the actual offset is at the start of the auth verifier *** ********************************************************************/ -void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, +BOOL make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, uchar lm_resp[24], uchar *nt_resp, size_t nt_len, char *domain, char *user, char *wks, @@ -706,7 +762,7 @@ void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, DEBUG(5,("make_rpc_auth_ntlmssp_resp\n")); - if (rsp == NULL) return; + if (rsp == NULL) return False; #ifdef DEBUG_PASSWORD DEBUG(100,("lm_resp\n")); @@ -782,6 +838,8 @@ void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, fstrcpy(rsp->wks , wks ); } rsp->sess_key[0] = 0; + + return True; } /******************************************************************* @@ -791,9 +849,9 @@ reads or writes an RPC_AUTH_NTLMSSP_RESP structure. *** lkclXXXX the actual offset is at the start of the auth verifier *** ********************************************************************/ -void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth) +BOOL smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth) { - if (rsp == NULL) return; + if (rsp == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_auth_ntlmssp_resp"); depth++; @@ -865,6 +923,8 @@ void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_st prs_uint8s(False, "nt_resp ", ps, depth, (uint8*)rsp->nt_resp , MIN(rsp->hdr_nt_resp .str_str_len, sizeof(rsp->nt_resp ))); prs_uint8s(False, "sess_key", ps, depth, (uint8*)rsp->sess_key, MIN(rsp->hdr_sess_key.str_str_len, sizeof(rsp->sess_key))); } + + return True; } /******************************************************************* @@ -888,28 +948,32 @@ BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 seq_nu return False; } return True; + + return True; } /******************************************************************* creates an RPC_AUTH_NTLMSSP_CHK structure. ********************************************************************/ -void make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, +BOOL make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 ver, uint32 crc32, uint32 seq_num) { - if (chk == NULL) return; + if (chk == NULL) return False; chk->ver = ver ; chk->reserved = 0x0; chk->crc32 = crc32 ; chk->seq_num = seq_num ; + + return True; } /******************************************************************* reads or writes an RPC_AUTH_NTLMSSP_CHK structure. ********************************************************************/ -void smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth) +BOOL smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth) { - if (chk == NULL) return; + if (chk == NULL) return False; prs_debug(ps, depth, desc, "smb_io_rpc_auth_ntlmssp_chk"); depth++; @@ -918,5 +982,7 @@ void smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_stru prs_uint32("reserved", ps, depth, &(chk->reserved)); prs_uint32("crc32 ", ps, depth, &(chk->crc32 )); prs_uint32("seq_num ", ps, depth, &(chk->seq_num )); + + return True; } diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index e5c015a6b3..7dae0702cd 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -2,9 +2,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1998, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1998, - * Copyright (C) Paul Ashton 1997-1998. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,21 +30,23 @@ extern int DEBUGLEVEL; /******************************************************************* makes a SAMR_Q_CLOSE_HND structure. ********************************************************************/ -void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd) +BOOL make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_close_hnd\n")); memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_close_hnd"); depth++; @@ -53,14 +55,16 @@ void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int smb_io_pol_hnd("pol", &(q_u->pol), ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_close_hnd"); depth++; @@ -71,17 +75,19 @@ void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_LOOKUP_DOMAIN structure. ********************************************************************/ -void make_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN *q_u, +BOOL make_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN *q_u, POLICY_HND *pol, const char *dom_name) { int len_name = strlen(dom_name); - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_lookup_domain\n")); @@ -89,14 +95,16 @@ void make_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN *q_u, make_uni_hdr(&(q_u->hdr_domain), len_name); make_unistr2(&(q_u->uni_domain), dom_name, len_name); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_lookup_domain(char *desc, SAMR_Q_LOOKUP_DOMAIN *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_lookup_domain(char *desc, SAMR_Q_LOOKUP_DOMAIN *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_lookup_domain"); depth++; @@ -109,14 +117,16 @@ void samr_io_q_lookup_domain(char *desc, SAMR_Q_LOOKUP_DOMAIN *q_u, prs_struct * smb_io_unihdr("hdr_domain", &(q_u->hdr_domain), ps, depth); smb_io_unistr2("uni_domain", &(q_u->uni_domain), q_u->hdr_domain.buffer, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_lookup_domain"); depth++; @@ -132,30 +142,34 @@ void samr_io_r_lookup_domain(char *desc, SAMR_R_LOOKUP_DOMAIN *r_u, prs_struct * } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, +BOOL make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, POLICY_HND *connect_pol, uint32 flags, DOM_SID *sid) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("samr_make_samr_q_open_domain\n")); memcpy(&q_u->connect_pol, connect_pol, sizeof(q_u->connect_pol)); q_u->flags = flags; make_dom_sid2(&(q_u->dom_sid), sid); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_open_domain"); depth++; @@ -169,15 +183,17 @@ void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, smb_io_dom_sid2("sid", &(q_u->dom_sid), ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_open_domain"); depth++; @@ -188,27 +204,31 @@ void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u, POLICY_HND *user_pol) +BOOL make_samr_q_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u, POLICY_HND *user_pol) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("samr_make_samr_q_unknown_2c\n")); memcpy(&q_u->user_pol, user_pol, sizeof(q_u->user_pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_unknown_2c(char *desc, SAMR_Q_UNKNOWN_2C *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_unknown_2c(char *desc, SAMR_Q_UNKNOWN_2C *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_unknown_2c"); depth++; @@ -217,29 +237,33 @@ void samr_io_q_unknown_2c(char *desc, SAMR_Q_UNKNOWN_2C *q_u, prs_struct *ps, i smb_io_pol_hnd("user_pol", &(q_u->user_pol), ps, depth); prs_align(ps); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_samr_r_unknown_2c(SAMR_R_UNKNOWN_2C *q_u, uint32 status) +BOOL make_samr_r_unknown_2c(SAMR_R_UNKNOWN_2C *q_u, uint32 status) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("samr_make_r_unknown_2c\n")); q_u->unknown_0 = 0x00160000; q_u->unknown_1 = 0x00000000; q_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_unknown_2c(char *desc, SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_unknown_2c(char *desc, SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_unknown_2c"); depth++; @@ -249,29 +273,33 @@ void samr_io_r_unknown_2c(char *desc, SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, i prs_uint32("unknown_0", ps, depth, &(r_u->unknown_0)); prs_uint32("unknown_1", ps, depth, &(r_u->unknown_1)); prs_uint32("status ", ps, depth, &(r_u->status )); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, +BOOL make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, POLICY_HND *user_pol, uint16 switch_value) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("samr_make_samr_q_unknown_3\n")); memcpy(&q_u->user_pol, user_pol, sizeof(q_u->user_pol)); q_u->switch_value = switch_value; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_unknown_3"); depth++; @@ -283,28 +311,32 @@ void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int prs_uint16("switch_value", ps, depth, &(q_u->switch_value)); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u, +BOOL make_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u, POLICY_HND *domain_pol, uint16 switch_value) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("samr_make_samr_q_query_dom_info\n")); memcpy(&q_u->domain_pol, domain_pol, sizeof(q_u->domain_pol)); q_u->switch_value = switch_value; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_dom_info(char *desc, SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_query_dom_info(char *desc, SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_dom_info"); depth++; @@ -316,26 +348,30 @@ void samr_io_q_query_dom_info(char *desc, SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_st prs_uint16("switch_value", ps, depth, &(q_u->switch_value)); prs_align(ps); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_unk_info3(SAM_UNK_INFO_3 *u_3) +BOOL make_unk_info3(SAM_UNK_INFO_3 *u_3) { - if (u_3 == NULL) return; + if (u_3 == NULL) return False; u_3->unknown_0 = 0x00000000; u_3->unknown_1 = 0x80000000; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_unk_info3(char *desc, SAM_UNK_INFO_3 *u_3, prs_struct *ps, int depth) +BOOL sam_io_unk_info3(char *desc, SAM_UNK_INFO_3 *u_3, prs_struct *ps, int depth) { - if (u_3 == NULL) return; + if (u_3 == NULL) return False; prs_debug(ps, depth, desc, "sam_io_unk_info3"); depth++; @@ -345,26 +381,30 @@ void sam_io_unk_info3(char *desc, SAM_UNK_INFO_3 *u_3, prs_struct *ps, int depth prs_align(ps); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_unk_info6(SAM_UNK_INFO_6 *u_6) +BOOL make_unk_info6(SAM_UNK_INFO_6 *u_6) { - if (u_6 == NULL) return; + if (u_6 == NULL) return False; u_6->unknown_0 = 0x00000000; u_6->ptr_0 = 1; memset(u_6->padding, 0, sizeof(u_6->padding)); /* 12 bytes zeros */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_unk_info6(char *desc, SAM_UNK_INFO_6 *u_6, prs_struct *ps, int depth) +BOOL sam_io_unk_info6(char *desc, SAM_UNK_INFO_6 *u_6, prs_struct *ps, int depth) { - if (u_6 == NULL) return; + if (u_6 == NULL) return False; prs_debug(ps, depth, desc, "sam_io_unk_info6"); depth++; @@ -375,24 +415,28 @@ void sam_io_unk_info6(char *desc, SAM_UNK_INFO_6 *u_6, prs_struct *ps, int depth prs_align(ps); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_unk_info7(SAM_UNK_INFO_7 *u_7) +BOOL make_unk_info7(SAM_UNK_INFO_7 *u_7) { - if (u_7 == NULL) return; + if (u_7 == NULL) return False; u_7->unknown_0 = 0x0003; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_unk_info7(char *desc, SAM_UNK_INFO_7 *u_7, prs_struct *ps, int depth) +BOOL sam_io_unk_info7(char *desc, SAM_UNK_INFO_7 *u_7, prs_struct *ps, int depth) { - if (u_7 == NULL) return; + if (u_7 == NULL) return False; prs_debug(ps, depth, desc, "sam_io_unk_info7"); depth++; @@ -400,17 +444,19 @@ void sam_io_unk_info7(char *desc, SAM_UNK_INFO_7 *u_7, prs_struct *ps, int depth prs_uint16("unknown_0", ps, depth, &u_7->unknown_0); /* 0x0003 */ prs_align(ps); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server) +BOOL make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server) { int len_domain = strlen(domain); int len_server = strlen(server); - if (u_2 == NULL) return; + if (u_2 == NULL) return False; u_2->unknown_0 = 0x00000000; u_2->unknown_1 = 0x80000000; @@ -434,14 +480,16 @@ void make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server) make_unistr2(&u_2->uni_domain, domain, len_domain); make_unistr2(&u_2->uni_server, server, len_server); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth) +BOOL sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth) { - if (u_2 == NULL) return; + if (u_2 == NULL) return False; prs_debug(ps, depth, desc, "sam_io_unk_info2"); depth++; @@ -475,26 +523,30 @@ void sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth prs_align(ps); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_unk_info1(SAM_UNK_INFO_1 *u_1) +BOOL make_unk_info1(SAM_UNK_INFO_1 *u_1) { - if (u_1 == NULL) return; + if (u_1 == NULL) return False; memset(u_1->padding, 0, sizeof(u_1->padding)); /* 12 bytes zeros */ u_1->unknown_1 = 0x80000000; u_1->unknown_2 = 0x00000000; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_unk_info1(char *desc, SAM_UNK_INFO_1 *u_1, prs_struct *ps, int depth) +BOOL sam_io_unk_info1(char *desc, SAM_UNK_INFO_1 *u_1, prs_struct *ps, int depth) { - if (u_1 == NULL) return; + if (u_1 == NULL) return False; prs_debug(ps, depth, desc, "sam_io_unk_info1"); depth++; @@ -505,16 +557,18 @@ void sam_io_unk_info1(char *desc, SAM_UNK_INFO_1 *u_1, prs_struct *ps, int depth prs_uint32("unknown_2", ps, depth, &u_1->unknown_2); /* 0x0000 0000 */ prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_DOMAIN_INFO structure. ********************************************************************/ -void make_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO *r_u, +BOOL make_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO *r_u, uint16 switch_value, SAM_UNK_CTR *ctr, uint32 status) { - if (r_u == NULL || ctr == NULL) return; + if (r_u == NULL || ctr == NULL) return False; DEBUG(5,("make_samr_r_query_dom_info\n")); @@ -528,14 +582,16 @@ void make_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO *r_u, r_u->ptr_0 = 1; r_u->ctr = ctr; } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_dom_info"); depth++; @@ -580,12 +636,15 @@ void samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_str { DEBUG(3,("samr_io_r_query_dom_info: unknown switch level 0x%x\n", r_u->switch_value)); - return; + r_u->status = 0xC0000000|NT_STATUS_INVALID_INFO_CLASS; + return False; } } } prs_uint32("status ", ps, depth, &(r_u->status)); + + return True; } @@ -594,12 +653,14 @@ void samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_str calculate length by adding up the size of the components. ********************************************************************/ -void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid) +BOOL make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid) { - if (sid3 == NULL) return; + if (sid3 == NULL) return False; sid3->sid = *sid; sid3->len = 2 + 8 + sid3->sid.num_auths * 4; + + return True; } /******************************************************************* @@ -609,9 +670,9 @@ this one's odd, because the length (in bytes) is specified at the beginning. the length _includes_ the length of the length, too :-) ********************************************************************/ -static void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth) +static BOOL sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth) { - if (sid3 == NULL) return; + if (sid3 == NULL) return False; prs_debug(ps, depth, desc, "sam_io_dom_sid3"); depth++; @@ -619,6 +680,8 @@ static void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int dep prs_uint16("len", ps, depth, &(sid3->len)); prs_align(ps); smb_io_dom_sid("", &(sid3->sid), ps, depth); + + return True; } /******************************************************************* @@ -633,7 +696,7 @@ unknown_6 : 0x0002 unknown_7 : 0x5800 or 0x0070 ********************************************************************/ -static void make_sam_sid_stuff(SAM_SID_STUFF *stf, +static BOOL make_sam_sid_stuff(SAM_SID_STUFF *stf, uint16 unknown_2, uint16 unknown_3, uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]) @@ -654,16 +717,18 @@ static void make_sam_sid_stuff(SAM_SID_STUFF *stf, stf->padding2 = 0x0000; memcpy(stf->sid, sid3, sizeof(DOM_SID3) * num_sid3s); + + return True; } /******************************************************************* reads or writes a SAM_SID_STUFF structure. ********************************************************************/ -static void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth) +static BOOL sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth) { int i; - if (stf == NULL) return; + if (stf == NULL) return False; DEBUG(5,("make_sam_sid_stuff\n")); @@ -686,18 +751,20 @@ static void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, in { sam_io_dom_sid3("", &(stf->sid[i]), ps, depth); } + + return True; } /******************************************************************* reads or writes a SAMR_R_UNKNOWN3 structure. ********************************************************************/ -void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, +BOOL make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, uint16 unknown_2, uint16 unknown_3, uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("samr_make_r_unknown_3\n")); @@ -714,6 +781,8 @@ void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, } r_u->status = status; + + return True; } @@ -729,13 +798,13 @@ is put at the beginning of the data stream. wierd. ********************************************************************/ -void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth) { int ptr_len0=0; int ptr_len1=0; int ptr_sid_stuff = 0; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_unknown_3"); depth++; @@ -794,14 +863,16 @@ void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* reads or writes a SAM_STR1 structure. ********************************************************************/ -static void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth) +static BOOL sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_str1"); depth++; @@ -811,16 +882,18 @@ static void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 smb_io_unistr2("unistr2", &(sam->uni_acct_name), acct_buf, ps, depth); /* account name unicode string */ smb_io_unistr2("unistr2", &(sam->uni_full_name), name_buf, ps, depth); /* full name unicode string */ smb_io_unistr2("unistr2", &(sam->uni_acct_desc), desc_buf, ps, depth); /* account description unicode string */ + + return True; } /******************************************************************* makes a SAM_ENTRY1 structure. ********************************************************************/ -static void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, +static BOOL make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, uint32 rid_user, uint16 acb_info) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_entry1\n")); @@ -832,14 +905,16 @@ static void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, make_uni_hdr(&(sam->hdr_acct_name), len_sam_name); make_uni_hdr(&(sam->hdr_user_name), len_sam_full); make_uni_hdr(&(sam->hdr_user_desc), len_sam_desc); + + return True; } /******************************************************************* reads or writes a SAM_ENTRY1 structure. ********************************************************************/ -static void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth) +static BOOL sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_entry1"); depth++; @@ -855,14 +930,16 @@ static void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int smb_io_unihdr("unihdr", &(sam->hdr_acct_name), ps, depth); /* account name unicode string header */ smb_io_unihdr("unihdr", &(sam->hdr_user_name), ps, depth); /* account name unicode string header */ smb_io_unihdr("unihdr", &(sam->hdr_user_desc), ps, depth); /* account name unicode string header */ + + return True; } /******************************************************************* reads or writes a SAM_STR2 structure. ********************************************************************/ -static void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) +static BOOL sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_str2"); depth++; @@ -871,16 +948,18 @@ static void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 smb_io_unistr2("unistr2", &(sam->uni_srv_name), acct_buf, ps, depth); /* account name unicode string */ smb_io_unistr2("unistr2", &(sam->uni_srv_desc), desc_buf, ps, depth); /* account description unicode string */ + + return True; } /******************************************************************* makes a SAM_ENTRY2 structure. ********************************************************************/ -static void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, +static BOOL make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, uint32 len_sam_name, uint32 len_sam_desc, uint32 rid_user, uint16 acb_info) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_entry2\n")); @@ -891,14 +970,16 @@ static void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, make_uni_hdr(&(sam->hdr_srv_name), len_sam_name); make_uni_hdr(&(sam->hdr_srv_desc), len_sam_desc); + + return True; } /******************************************************************* reads or writes a SAM_ENTRY2 structure. ********************************************************************/ -static void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth) +static BOOL sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_entry2"); depth++; @@ -913,14 +994,16 @@ static void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int smb_io_unihdr("unihdr", &(sam->hdr_srv_name), ps, depth); /* account name unicode string header */ smb_io_unihdr("unihdr", &(sam->hdr_srv_desc), ps, depth); /* account name unicode string header */ + + return True; } /******************************************************************* reads or writes a SAM_STR3 structure. ********************************************************************/ -static void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) +static BOOL sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_str3"); depth++; @@ -929,15 +1012,17 @@ static void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 smb_io_unistr2("unistr2", &(sam->uni_grp_name), acct_buf, ps, depth); /* account name unicode string */ smb_io_unistr2("unistr2", &(sam->uni_grp_desc), desc_buf, ps, depth); /* account description unicode string */ + + return True; } /******************************************************************* makes a SAM_ENTRY3 structure. ********************************************************************/ -static void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, +static BOOL make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_entry3\n")); @@ -947,14 +1032,16 @@ static void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, make_uni_hdr(&(sam->hdr_grp_name), len_grp_name); make_uni_hdr(&(sam->hdr_grp_desc), len_grp_desc); + + return True; } /******************************************************************* reads or writes a SAM_ENTRY3 structure. ********************************************************************/ -static void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth) +static BOOL sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_entry3"); depth++; @@ -968,29 +1055,33 @@ static void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int smb_io_unihdr("unihdr", &(sam->hdr_grp_name), ps, depth); /* account name unicode string header */ smb_io_unihdr("unihdr", &(sam->hdr_grp_desc), ps, depth); /* account name unicode string header */ + + return True; } /******************************************************************* makes a SAM_ENTRY4 structure. ********************************************************************/ -static void make_sam_entry4(SAM_ENTRY4 *sam, uint32 user_idx, +static BOOL make_sam_entry4(SAM_ENTRY4 *sam, uint32 user_idx, uint32 len_acct_name) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_entry4\n")); sam->user_idx = user_idx; make_str_hdr(&(sam->hdr_acct_name), len_acct_name, len_acct_name, len_acct_name != 0); + + return True; } /******************************************************************* reads or writes a SAM_ENTRY4 structure. ********************************************************************/ -static void sam_io_sam_entry4(char *desc, SAM_ENTRY4 *sam, prs_struct *ps, int depth) +static BOOL sam_io_sam_entry4(char *desc, SAM_ENTRY4 *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_entry4"); depth++; @@ -999,29 +1090,33 @@ static void sam_io_sam_entry4(char *desc, SAM_ENTRY4 *sam, prs_struct *ps, int d prs_uint32("user_idx", ps, depth, &(sam->user_idx)); smb_io_strhdr("strhdr", &(sam->hdr_acct_name), ps, depth); + + return True; } /******************************************************************* makes a SAM_ENTRY5 structure. ********************************************************************/ -static void make_sam_entry5(SAM_ENTRY5 *sam, uint32 grp_idx, +static BOOL make_sam_entry5(SAM_ENTRY5 *sam, uint32 grp_idx, uint32 len_grp_name) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_entry5\n")); sam->grp_idx = grp_idx; make_str_hdr(&(sam->hdr_grp_name), len_grp_name, len_grp_name, len_grp_name != 0); + + return True; } /******************************************************************* reads or writes a SAM_ENTRY5 structure. ********************************************************************/ -static void sam_io_sam_entry5(char *desc, SAM_ENTRY5 *sam, prs_struct *ps, int depth) +static BOOL sam_io_sam_entry5(char *desc, SAM_ENTRY5 *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_entry5"); depth++; @@ -1030,27 +1125,31 @@ static void sam_io_sam_entry5(char *desc, SAM_ENTRY5 *sam, prs_struct *ps, int d prs_uint32("grp_idx", ps, depth, &(sam->grp_idx)); smb_io_strhdr("strhdr", &(sam->hdr_grp_name), ps, depth); + + return True; } /******************************************************************* makes a SAM_ENTRY structure. ********************************************************************/ -static void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid) +static BOOL make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid) { - if (sam == NULL) return; + if (sam == NULL) return False; DEBUG(5,("make_sam_entry\n")); sam->rid = rid; make_uni_hdr(&(sam->hdr_name), len_sam_name); + + return True; } /******************************************************************* reads or writes a SAM_ENTRY structure. ********************************************************************/ -static void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth) +static BOOL sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth) { - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_entry"); depth++; @@ -1058,17 +1157,19 @@ static void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int de prs_align(ps); prs_uint32("rid", ps, depth, &(sam->rid )); smb_io_unihdr("unihdr", &(sam->hdr_name), ps, depth); /* account name unicode string header */ + + return True; } /******************************************************************* makes a SAMR_Q_ENUM_DOM_USERS structure. ********************************************************************/ -void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, +BOOL make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, uint32 start_idx, uint16 acb_mask, uint16 unk_1, uint32 size) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_enum_dom_users\n")); @@ -1078,14 +1179,16 @@ void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, q_e->acb_mask = acb_mask; q_e->unknown_1 = unk_1; q_e->max_size = size; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_enum_dom_users"); depth++; @@ -1102,19 +1205,21 @@ void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struc prs_uint32("max_size ", ps, depth, &(q_e->max_size )); prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_ENUM_DOM_USERS structure. ********************************************************************/ -void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, +BOOL make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, uint32 next_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_enum_dom_users\n")); @@ -1135,7 +1240,7 @@ void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, if (r_u->sam == NULL || r_u->uni_acct_name == NULL) { DEBUG(0,("NULL pointers in SAMR_R_QUERY_DISPINFO\n")); - return; + return False; } for (i = 0; i < num_sam_entries; i++) @@ -1157,16 +1262,18 @@ void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_enum_dom_users"); depth++; @@ -1191,7 +1298,9 @@ void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struc if ((r_u->sam == NULL || r_u->uni_acct_name == NULL) && r_u->num_entries2 != 0) { DEBUG(0,("NULL pointers in SAMR_R_QUERY_DISPINFO\n")); - return; + r_u->num_entries4 = 0; + r_u->status = 0xC0000000|NT_STATUS_MEMORY_NOT_ALLOCATED; + return False; } for (i = 0; i < r_u->num_entries2; i++) @@ -1212,16 +1321,18 @@ void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struc prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_DISPINFO structure. ********************************************************************/ -void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, +BOOL make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, uint16 switch_level, uint32 start_idx, uint32 max_entries) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_query_dispinfo\n")); @@ -1232,14 +1343,16 @@ void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, q_e->start_idx = start_idx; q_e->max_entries = max_entries; q_e->max_size = 0xffff; /* Not especially useful */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_dispinfo"); depth++; @@ -1255,13 +1368,15 @@ void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struc prs_uint32("start_idx ", ps, depth, &(q_e->start_idx )); prs_uint32("max_entries ", ps, depth, &(q_e->max_entries )); prs_uint32("max_size ", ps, depth, &(q_e->max_size )); + + return True; } /******************************************************************* makes a SAM_DISPINFO_1 structure. ********************************************************************/ -void make_sam_dispinfo_1(SAM_DISPINFO_1 *sam, uint32 *num_entries, +BOOL make_sam_dispinfo_1(SAM_DISPINFO_1 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]) { @@ -1270,7 +1385,7 @@ void make_sam_dispinfo_1(SAM_DISPINFO_1 *sam, uint32 *num_entries, uint32 dsize = 0; int i; - if (sam == NULL || num_entries == NULL || data_size == NULL) return; + if (sam == NULL || num_entries == NULL || data_size == NULL) return False; DEBUG(5,("make_sam_dispinfo_1\n")); @@ -1297,16 +1412,18 @@ void make_sam_dispinfo_1(SAM_DISPINFO_1 *sam, uint32 *num_entries, *num_entries = i; *data_size = dsize; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 *sam, uint32 num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 *sam, uint32 num_entries, prs_struct *ps, int depth) { int i; - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_dispinfo_1"); depth++; @@ -1330,13 +1447,15 @@ static void sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 *sam, uint32 num_en sam->sam[i].hdr_user_desc.buffer, ps, depth); } + + return True; } /******************************************************************* makes a SAM_DISPINFO_2 structure. ********************************************************************/ -void make_sam_dispinfo_2(SAM_DISPINFO_2 *sam, uint32 *num_entries, +BOOL make_sam_dispinfo_2(SAM_DISPINFO_2 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]) { @@ -1345,7 +1464,7 @@ void make_sam_dispinfo_2(SAM_DISPINFO_2 *sam, uint32 *num_entries, uint32 dsize = 0; int i; - if (sam == NULL || num_entries == NULL || data_size == NULL) return; + if (sam == NULL || num_entries == NULL || data_size == NULL) return False; DEBUG(5,("make_sam_dispinfo_2\n")); @@ -1370,16 +1489,18 @@ void make_sam_dispinfo_2(SAM_DISPINFO_2 *sam, uint32 *num_entries, *num_entries = i; *data_size = dsize; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_sam_dispinfo_2(char *desc, SAM_DISPINFO_2 *sam, uint32 num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_2(char *desc, SAM_DISPINFO_2 *sam, uint32 num_entries, prs_struct *ps, int depth) { int i; - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_dispinfo_2"); depth++; @@ -1402,13 +1523,15 @@ static void sam_io_sam_dispinfo_2(char *desc, SAM_DISPINFO_2 *sam, uint32 num_en sam->sam[i].hdr_srv_desc.buffer, ps, depth); } + + return True; } /******************************************************************* makes a SAM_DISPINFO_3 structure. ********************************************************************/ -void make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries, +BOOL make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, DOMAIN_GRP *grp) { @@ -1417,7 +1540,7 @@ void make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries, uint32 dsize = 0; int i; - if (sam == NULL || num_entries == NULL || data_size == NULL) return; + if (sam == NULL || num_entries == NULL || data_size == NULL) return False; DEBUG(5,("make_sam_dispinfo_3\n")); @@ -1442,16 +1565,18 @@ void make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries, *num_entries = i; *data_size = dsize; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 *sam, int num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 *sam, int num_entries, prs_struct *ps, int depth) { int i; - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_dispinfo_3"); depth++; @@ -1474,13 +1599,15 @@ static void sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 *sam, int num_entri sam->sam[i].hdr_grp_desc.buffer, ps, depth); } + + return True; } /******************************************************************* makes a SAM_DISPINFO_4 structure. ********************************************************************/ -void make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries, +BOOL make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]) { @@ -1490,7 +1617,7 @@ void make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries, uint32 dsize = 0; int i; - if (sam == NULL || num_entries == NULL || data_size == NULL) return; + if (sam == NULL || num_entries == NULL || data_size == NULL) return False; DEBUG(5,("make_sam_dispinfo_4\n")); @@ -1513,16 +1640,18 @@ void make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries, *num_entries = i; *data_size = dsize; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 *sam, int num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 *sam, int num_entries, prs_struct *ps, int depth) { int i; - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_dispinfo_4"); depth++; @@ -1543,13 +1672,15 @@ static void sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 *sam, int num_entri smb_io_string2("acct_name", &(sam->str[i].acct_name), sam->sam[i].hdr_acct_name.buffer, ps, depth); } + + return True; } /******************************************************************* makes a SAM_DISPINFO_5 structure. ********************************************************************/ -void make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries, +BOOL make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries, uint32 *data_size, uint32 start_idx, DOMAIN_GRP *grp) { @@ -1558,7 +1689,7 @@ void make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries, uint32 dsize = 0; int i; - if (sam == NULL || num_entries == NULL || data_size == NULL) return; + if (sam == NULL || num_entries == NULL || data_size == NULL) return False; DEBUG(5,("make_sam_dispinfo_5\n")); @@ -1581,16 +1712,18 @@ void make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries, *num_entries = i; *data_size = dsize; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_sam_dispinfo_5(char *desc, SAM_DISPINFO_5 *sam, int num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_5(char *desc, SAM_DISPINFO_5 *sam, int num_entries, prs_struct *ps, int depth) { int i; - if (sam == NULL) return; + if (sam == NULL) return False; prs_debug(ps, depth, desc, "sam_io_sam_dispinfo_5"); depth++; @@ -1611,18 +1744,20 @@ static void sam_io_sam_dispinfo_5(char *desc, SAM_DISPINFO_5 *sam, int num_entri smb_io_string2("grp_name", &(sam->str[i].grp_name), sam->sam[i].hdr_grp_name.buffer, ps, depth); } + + return True; } /******************************************************************* makes a SAMR_R_QUERY_DISPINFO structure. ********************************************************************/ -void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, +BOOL make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, uint32 num_entries, uint32 data_size, uint16 switch_level, SAM_DISPINFO_CTR *ctr, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_dispinfo: level %d\n", switch_level)); @@ -1636,15 +1771,17 @@ void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, r_u->ctr = ctr; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_dispinfo"); depth++; @@ -1697,30 +1834,34 @@ void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct prs_align(ps); prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_OPEN_GROUP structure. ********************************************************************/ -void make_samr_q_open_group(SAMR_Q_OPEN_GROUP *q_c, +BOOL make_samr_q_open_group(SAMR_Q_OPEN_GROUP *q_c, POLICY_HND *hnd, uint32 unk, uint32 rid) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_open_group\n")); memcpy(&(q_c->domain_pol), hnd, sizeof(q_c->domain_pol)); q_c->unknown = unk; q_c->rid_group = rid; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_open_group(char *desc, SAMR_Q_OPEN_GROUP *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_open_group(char *desc, SAMR_Q_OPEN_GROUP *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_open_group"); depth++; @@ -1731,14 +1872,16 @@ void samr_io_q_open_group(char *desc, SAMR_Q_OPEN_GROUP *q_u, prs_struct *ps, i prs_uint32("unknown ", ps, depth, &(q_u->unknown )); prs_uint32("rid_group", ps, depth, &(q_u->rid_group)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_open_group(char *desc, SAMR_R_OPEN_GROUP *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_open_group(char *desc, SAMR_R_OPEN_GROUP *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_open_group"); depth++; @@ -1749,18 +1892,20 @@ void samr_io_r_open_group(char *desc, SAMR_R_OPEN_GROUP *r_u, prs_struct *ps, i prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a GROUP_INFO1 structure. ********************************************************************/ -void make_samr_group_info1(GROUP_INFO1 *gr1, +BOOL make_samr_group_info1(GROUP_INFO1 *gr1, char *acct_name, char *acct_desc) { int desc_len = acct_desc != NULL ? strlen(acct_desc) : 0; int acct_len = acct_name != NULL ? strlen(acct_name) : 0; - if (gr1 == NULL) return; + if (gr1 == NULL) return False; DEBUG(5,("make_samr_group_info1\n")); @@ -1773,15 +1918,17 @@ void make_samr_group_info1(GROUP_INFO1 *gr1, make_unistr2(&(gr1->uni_acct_name), acct_name, acct_len); make_unistr2(&(gr1->uni_acct_desc), acct_desc, desc_len); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_group_info1(char *desc, GROUP_INFO1 *gr1, prs_struct *ps, int depth) +BOOL samr_io_group_info1(char *desc, GROUP_INFO1 *gr1, prs_struct *ps, int depth) { - if (gr1 == NULL) return; + if (gr1 == NULL) return False; prs_debug(ps, depth, desc, "samr_io_group_info1"); depth++; @@ -1799,29 +1946,33 @@ void samr_io_group_info1(char *desc, GROUP_INFO1 *gr1, prs_struct *ps, int dept prs_align(ps); smb_io_unistr2("uni_acct_desc", &(gr1->uni_acct_desc), gr1->hdr_acct_desc.buffer, ps, depth); + + return True; } /******************************************************************* makes a GROUP_INFO4 structure. ********************************************************************/ -void make_samr_group_info4(GROUP_INFO4 *gr4, const char *acct_desc) +BOOL make_samr_group_info4(GROUP_INFO4 *gr4, const char *acct_desc) { int acct_len = acct_desc != NULL ? strlen(acct_desc) : 0; - if (gr4 == NULL) return; + if (gr4 == NULL) return False; DEBUG(5,("make_samr_group_info4\n")); make_uni_hdr(&(gr4->hdr_acct_desc), acct_len); make_unistr2(&(gr4->uni_acct_desc), acct_desc, acct_len); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_group_info4(char *desc, GROUP_INFO4 *gr4, prs_struct *ps, int depth) +BOOL samr_io_group_info4(char *desc, GROUP_INFO4 *gr4, prs_struct *ps, int depth) { - if (gr4 == NULL) return; + if (gr4 == NULL) return False; prs_debug(ps, depth, desc, "samr_io_group_info4"); depth++; @@ -1830,14 +1981,16 @@ void samr_io_group_info4(char *desc, GROUP_INFO4 *gr4, prs_struct *ps, int dept smb_io_unihdr ("hdr_acct_desc", &(gr4->hdr_acct_desc) , ps, depth); smb_io_unistr2("uni_acct_desc", &(gr4->uni_acct_desc), gr4->hdr_acct_desc.buffer, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_group_info_ctr(char *desc, GROUP_INFO_CTR *ctr, prs_struct *ps, int depth) +BOOL samr_group_info_ctr(char *desc, GROUP_INFO_CTR *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "samr_group_info_ctr"); depth++; @@ -1865,18 +2018,20 @@ void samr_group_info_ctr(char *desc, GROUP_INFO_CTR *ctr, prs_struct *ps, int d } prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_Q_CREATE_DOM_GROUP structure. ********************************************************************/ -void make_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_e, +BOOL make_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_e, POLICY_HND *pol, const char *acct_desc) { int acct_len = acct_desc != NULL ? strlen(acct_desc) : 0; - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_create_dom_group\n")); @@ -1887,15 +2042,17 @@ void make_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_e, q_e->unknown_1 = 0x0002; q_e->unknown_2 = 0x0001; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_create_dom_group(char *desc, SAMR_Q_CREATE_DOM_GROUP *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_create_dom_group(char *desc, SAMR_Q_CREATE_DOM_GROUP *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_create_dom_group"); depth++; @@ -1911,16 +2068,18 @@ void samr_io_q_create_dom_group(char *desc, SAMR_Q_CREATE_DOM_GROUP *q_e, prs_s prs_uint16("unknown_1", ps, depth, &(q_e->unknown_1)); prs_uint16("unknown_2", ps, depth, &(q_e->unknown_2)); + + return True; } /******************************************************************* makes a SAMR_R_CREATE_DOM_GROUP structure. ********************************************************************/ -void make_samr_r_create_dom_group(SAMR_R_CREATE_DOM_GROUP *r_u, POLICY_HND *pol, +BOOL make_samr_r_create_dom_group(SAMR_R_CREATE_DOM_GROUP *r_u, POLICY_HND *pol, uint32 rid, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_create_dom_group\n")); @@ -1928,15 +2087,17 @@ void make_samr_r_create_dom_group(SAMR_R_CREATE_DOM_GROUP *r_u, POLICY_HND *pol, r_u->rid = rid ; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_create_dom_group(char *desc, SAMR_R_CREATE_DOM_GROUP *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_create_dom_group(char *desc, SAMR_R_CREATE_DOM_GROUP *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_create_dom_group"); depth++; @@ -1948,26 +2109,30 @@ void samr_io_r_create_dom_group(char *desc, SAMR_R_CREATE_DOM_GROUP *r_u, prs_s prs_uint32("rid ", ps, depth, &(r_u->rid )); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_DELETE_DOM_GROUP structure. ********************************************************************/ -void make_samr_q_delete_dom_group(SAMR_Q_DELETE_DOM_GROUP *q_c, POLICY_HND *hnd) +BOOL make_samr_q_delete_dom_group(SAMR_Q_DELETE_DOM_GROUP *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_delete_dom_group\n")); memcpy(&(q_c->group_pol), hnd, sizeof(q_c->group_pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_delete_dom_group(char *desc, SAMR_Q_DELETE_DOM_GROUP *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_delete_dom_group(char *desc, SAMR_Q_DELETE_DOM_GROUP *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_delete_dom_group"); depth++; @@ -1975,27 +2140,31 @@ void samr_io_q_delete_dom_group(char *desc, SAMR_Q_DELETE_DOM_GROUP *q_u, prs_s prs_align(ps); smb_io_pol_hnd("group_pol", &(q_u->group_pol), ps, depth); + + return True; } /******************************************************************* makes a SAMR_R_DELETE_DOM_GROUP structure. ********************************************************************/ -void make_samr_r_delete_dom_group(SAMR_R_DELETE_DOM_GROUP *r_u, +BOOL make_samr_r_delete_dom_group(SAMR_R_DELETE_DOM_GROUP *r_u, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_delete_dom_group\n")); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_delete_dom_group(char *desc, SAMR_R_DELETE_DOM_GROUP *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_delete_dom_group(char *desc, SAMR_R_DELETE_DOM_GROUP *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_delete_dom_group"); depth++; @@ -2003,6 +2172,8 @@ void samr_io_r_delete_dom_group(char *desc, SAMR_R_DELETE_DOM_GROUP *r_u, prs_s prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } @@ -2010,26 +2181,28 @@ void samr_io_r_delete_dom_group(char *desc, SAMR_R_DELETE_DOM_GROUP *r_u, prs_s /******************************************************************* makes a SAMR_Q_DEL_GROUPMEM structure. ********************************************************************/ -void make_samr_q_del_groupmem(SAMR_Q_DEL_GROUPMEM *q_e, +BOOL make_samr_q_del_groupmem(SAMR_Q_DEL_GROUPMEM *q_e, POLICY_HND *pol, uint32 rid) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_del_groupmem\n")); memcpy(&(q_e->pol), pol, sizeof(*pol)); q_e->rid = rid; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_del_groupmem(char *desc, SAMR_Q_DEL_GROUPMEM *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_del_groupmem(char *desc, SAMR_Q_DEL_GROUPMEM *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_del_groupmem"); depth++; @@ -2040,29 +2213,33 @@ void samr_io_q_del_groupmem(char *desc, SAMR_Q_DEL_GROUPMEM *q_e, prs_struct *p prs_align(ps); prs_uint32("rid ", ps, depth, &(q_e->rid)); + + return True; } /******************************************************************* makes a SAMR_R_DEL_GROUPMEM structure. ********************************************************************/ -void make_samr_r_del_groupmem(SAMR_R_DEL_GROUPMEM *r_u, POLICY_HND *pol, +BOOL make_samr_r_del_groupmem(SAMR_R_DEL_GROUPMEM *r_u, POLICY_HND *pol, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_del_groupmem\n")); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_del_groupmem(char *desc, SAMR_R_DEL_GROUPMEM *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_del_groupmem(char *desc, SAMR_R_DEL_GROUPMEM *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_del_groupmem"); depth++; @@ -2070,17 +2247,19 @@ void samr_io_r_del_groupmem(char *desc, SAMR_R_DEL_GROUPMEM *r_u, prs_struct *p prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_ADD_GROUPMEM structure. ********************************************************************/ -void make_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM *q_e, +BOOL make_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM *q_e, POLICY_HND *pol, uint32 rid) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_add_groupmem\n")); @@ -2088,15 +2267,17 @@ void make_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM *q_e, q_e->rid = rid; q_e->unknown = 0x0005; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_add_groupmem(char *desc, SAMR_Q_ADD_GROUPMEM *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_add_groupmem(char *desc, SAMR_Q_ADD_GROUPMEM *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_add_groupmem"); depth++; @@ -2108,29 +2289,33 @@ void samr_io_q_add_groupmem(char *desc, SAMR_Q_ADD_GROUPMEM *q_e, prs_struct *p prs_uint32("rid ", ps, depth, &(q_e->rid)); prs_uint32("unknown", ps, depth, &(q_e->unknown)); + + return True; } /******************************************************************* makes a SAMR_R_ADD_GROUPMEM structure. ********************************************************************/ -void make_samr_r_add_groupmem(SAMR_R_ADD_GROUPMEM *r_u, POLICY_HND *pol, +BOOL make_samr_r_add_groupmem(SAMR_R_ADD_GROUPMEM *r_u, POLICY_HND *pol, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_add_groupmem\n")); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_add_groupmem(char *desc, SAMR_R_ADD_GROUPMEM *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_add_groupmem(char *desc, SAMR_R_ADD_GROUPMEM *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_add_groupmem"); depth++; @@ -2138,30 +2323,34 @@ void samr_io_r_add_groupmem(char *desc, SAMR_R_ADD_GROUPMEM *r_u, prs_struct *p prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_SET_GROUPINFO structure. ********************************************************************/ -void make_samr_q_set_groupinfo(SAMR_Q_SET_GROUPINFO *q_e, +BOOL make_samr_q_set_groupinfo(SAMR_Q_SET_GROUPINFO *q_e, POLICY_HND *pol, GROUP_INFO_CTR *ctr) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_set_groupinfo\n")); memcpy(&(q_e->pol), pol, sizeof(*pol)); q_e->ctr = ctr; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_set_groupinfo(char *desc, SAMR_Q_SET_GROUPINFO *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_set_groupinfo(char *desc, SAMR_Q_SET_GROUPINFO *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_set_groupinfo"); depth++; @@ -2172,29 +2361,33 @@ void samr_io_q_set_groupinfo(char *desc, SAMR_Q_SET_GROUPINFO *q_e, prs_struct prs_align(ps); samr_group_info_ctr("ctr", q_e->ctr, ps, depth); + + return True; } /******************************************************************* makes a SAMR_R_SET_GROUPINFO structure. ********************************************************************/ -void make_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO *r_u, +BOOL make_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO *r_u, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_set_groupinfo\n")); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_set_groupinfo(char *desc, SAMR_R_SET_GROUPINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_set_groupinfo(char *desc, SAMR_R_SET_GROUPINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_set_groupinfo"); depth++; @@ -2202,31 +2395,35 @@ void samr_io_r_set_groupinfo(char *desc, SAMR_R_SET_GROUPINFO *r_u, prs_struct prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_GROUPINFO structure. ********************************************************************/ -void make_samr_q_query_groupinfo(SAMR_Q_QUERY_GROUPINFO *q_e, +BOOL make_samr_q_query_groupinfo(SAMR_Q_QUERY_GROUPINFO *q_e, POLICY_HND *pol, uint16 switch_level) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_query_groupinfo\n")); memcpy(&(q_e->pol), pol, sizeof(*pol)); q_e->switch_level = switch_level; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_groupinfo(char *desc, SAMR_Q_QUERY_GROUPINFO *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_query_groupinfo(char *desc, SAMR_Q_QUERY_GROUPINFO *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_groupinfo"); depth++; @@ -2237,31 +2434,35 @@ void samr_io_q_query_groupinfo(char *desc, SAMR_Q_QUERY_GROUPINFO *q_e, prs_str prs_align(ps); prs_uint16("switch_level", ps, depth, &(q_e->switch_level)); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_GROUPINFO structure. ********************************************************************/ -void make_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO *r_u, GROUP_INFO_CTR *ctr, +BOOL make_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO *r_u, GROUP_INFO_CTR *ctr, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_groupinfo\n")); r_u->ptr = (status == 0x0 && ctr != NULL) ? 1 : 0; r_u->ctr = ctr; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_groupinfo(char *desc, SAMR_R_QUERY_GROUPINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_groupinfo(char *desc, SAMR_R_QUERY_GROUPINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_groupinfo"); depth++; @@ -2276,27 +2477,31 @@ void samr_io_r_query_groupinfo(char *desc, SAMR_R_QUERY_GROUPINFO *r_u, prs_str } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_GROUPMEM structure. ********************************************************************/ -void make_samr_q_query_groupmem(SAMR_Q_QUERY_GROUPMEM *q_c, POLICY_HND *hnd) +BOOL make_samr_q_query_groupmem(SAMR_Q_QUERY_GROUPMEM *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_query_groupmem\n")); memcpy(&(q_c->group_pol), hnd, sizeof(q_c->group_pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_groupmem(char *desc, SAMR_Q_QUERY_GROUPMEM *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_query_groupmem(char *desc, SAMR_Q_QUERY_GROUPMEM *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_groupmem"); depth++; @@ -2304,15 +2509,17 @@ void samr_io_q_query_groupmem(char *desc, SAMR_Q_QUERY_GROUPMEM *q_u, prs_struc prs_align(ps); smb_io_pol_hnd("group_pol", &(q_u->group_pol), ps, depth); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_GROUPMEM structure. ********************************************************************/ -void make_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM *r_u, +BOOL make_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM *r_u, uint32 num_entries, uint32 *rid, uint32 *attr, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_groupmem\n")); @@ -2337,16 +2544,18 @@ void make_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struct *ps, int depth) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_groupmem"); depth++; @@ -2383,29 +2592,33 @@ void samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struc } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_USERGROUPS structure. ********************************************************************/ -void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, +BOOL make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, POLICY_HND *hnd) { - if (q_u == NULL || hnd == NULL) return; + if (q_u == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_query_usergroups\n")); memcpy(&(q_u->pol), hnd, sizeof(q_u->pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_usergroups"); depth++; @@ -2414,15 +2627,17 @@ void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_s smb_io_pol_hnd("pol", &(q_u->pol), ps, depth); prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_USERGROUPS structure. ********************************************************************/ -void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, +BOOL make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, uint32 num_gids, DOM_GID *gid, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_usergroups\n")); @@ -2443,15 +2658,17 @@ void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_usergroups"); depth++; @@ -2477,15 +2694,17 @@ void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_s } } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_ENUM_DOM_GROUPS structure. ********************************************************************/ -void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, uint32 size) +BOOL make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, uint32 size) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_enum_dom_groups\n")); @@ -2493,15 +2712,17 @@ void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, u q_e->unknown_0 = 0; q_e->max_size = size; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_enum_dom_groups"); depth++; @@ -2515,19 +2736,21 @@ void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_stru prs_uint32("max_size ", ps, depth, &(q_e->max_size )); prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_ENUM_DOM_GROUPS structure. ********************************************************************/ -void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, +BOOL make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, uint32 num_sam_entries, DOMAIN_GRP *grps, uint32 status) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_enum_dom_groups\n")); @@ -2568,16 +2791,18 @@ void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_enum_dom_groups"); depth++; @@ -2610,15 +2835,17 @@ void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_stru prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_ENUM_DOM_ALIASES structure. ********************************************************************/ -void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size) +BOOL make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_enum_dom_aliases\n")); @@ -2626,15 +2853,17 @@ void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, q_e->unknown_0 = 0; q_e->max_size = size; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_enum_dom_aliases"); depth++; @@ -2648,19 +2877,21 @@ void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_s prs_uint32("max_size ", ps, depth, &(q_e->max_size )); prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_ENUM_DOM_ALIASES structure. ********************************************************************/ -void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, +BOOL make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 num_sam_entries, LOCAL_GRP *alss, uint32 status) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_enum_dom_aliases\n")); @@ -2701,16 +2932,18 @@ void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_enum_dom_aliases"); depth++; @@ -2743,30 +2976,34 @@ void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_s prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a ALIAS_INFO3 structure. ********************************************************************/ -void make_samr_alias_info3(ALIAS_INFO3 *al3, const char *acct_desc) +BOOL make_samr_alias_info3(ALIAS_INFO3 *al3, const char *acct_desc) { int acct_len = acct_desc != NULL ? strlen(acct_desc) : 0; - if (al3 == NULL) return; + if (al3 == NULL) return False; DEBUG(5,("make_samr_alias_info3\n")); make_uni_hdr(&(al3->hdr_acct_desc), acct_len); make_unistr2(&(al3->uni_acct_desc), acct_desc, acct_len); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_alias_info3(char *desc, ALIAS_INFO3 *al3, prs_struct *ps, int depth) +BOOL samr_io_alias_info3(char *desc, ALIAS_INFO3 *al3, prs_struct *ps, int depth) { - if (al3 == NULL) return; + if (al3 == NULL) return False; prs_debug(ps, depth, desc, "samr_io_alias_info3"); depth++; @@ -2775,14 +3012,16 @@ void samr_io_alias_info3(char *desc, ALIAS_INFO3 *al3, prs_struct *ps, int dept smb_io_unihdr ("hdr_acct_desc", &(al3->hdr_acct_desc) , ps, depth); smb_io_unistr2("uni_acct_desc", &(al3->uni_acct_desc), al3->hdr_acct_desc.buffer, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_alias_info_ctr(char *desc, ALIAS_INFO_CTR *ctr, prs_struct *ps, int depth) +BOOL samr_alias_info_ctr(char *desc, ALIAS_INFO_CTR *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "samr_alias_info_ctr"); depth++; @@ -2805,32 +3044,36 @@ void samr_alias_info_ctr(char *desc, ALIAS_INFO_CTR *ctr, prs_struct *ps, int d } prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_ALIASINFO structure. ********************************************************************/ -void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, +BOOL make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, POLICY_HND *pol, uint16 switch_level) { - if (q_e == NULL || pol == NULL) return; + if (q_e == NULL || pol == NULL) return False; DEBUG(5,("make_samr_q_query_aliasinfo\n")); memcpy(&(q_e->pol), pol, sizeof(*pol)); q_e->switch_level = switch_level; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth) +BOOL samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth) { - if (q_e == NULL) return; + if (q_e == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_aliasinfo"); depth++; @@ -2841,31 +3084,35 @@ void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_str prs_align(ps); prs_uint16("switch_level", ps, depth, &(q_e->switch_level)); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_ALIASINFO structure. ********************************************************************/ -void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, ALIAS_INFO_CTR *ctr, +BOOL make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, ALIAS_INFO_CTR *ctr, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_aliasinfo\n")); r_u->ptr = (status == 0x0 && ctr != NULL) ? 1 : 0; r_u->ctr = ctr; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_aliasinfo"); depth++; @@ -2880,30 +3127,34 @@ void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_str } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_SET_ALIASINFO structure. ********************************************************************/ -void make_samr_q_set_aliasinfo(SAMR_Q_SET_ALIASINFO *q_u, POLICY_HND *hnd, +BOOL make_samr_q_set_aliasinfo(SAMR_Q_SET_ALIASINFO *q_u, POLICY_HND *hnd, ALIAS_INFO_CTR *ctr) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_set_aliasinfo\n")); memcpy(&(q_u->alias_pol), hnd, sizeof(q_u->alias_pol)); q_u->ctr = ctr; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_set_aliasinfo(char *desc, SAMR_Q_SET_ALIASINFO *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_set_aliasinfo(char *desc, SAMR_Q_SET_ALIASINFO *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_set_aliasinfo"); depth++; @@ -2912,20 +3163,24 @@ void samr_io_q_set_aliasinfo(char *desc, SAMR_Q_SET_ALIASINFO *q_u, prs_struct smb_io_pol_hnd("alias_pol", &(q_u->alias_pol), ps, depth); samr_alias_info_ctr("ctr", q_u->ctr, ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_set_aliasinfo(char *desc, SAMR_R_SET_ALIASINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_set_aliasinfo(char *desc, SAMR_R_SET_ALIASINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_set_aliasinfo"); depth++; prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } @@ -2933,11 +3188,11 @@ void samr_io_r_set_aliasinfo(char *desc, SAMR_R_SET_ALIASINFO *r_u, prs_struct /******************************************************************* makes a SAMR_Q_QUERY_USERALIASES structure. ********************************************************************/ -void make_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u, +BOOL make_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u, POLICY_HND *hnd, DOM_SID *sid) { - if (q_u == NULL || hnd == NULL) return; + if (q_u == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_query_useraliases\n")); @@ -2951,17 +3206,19 @@ void make_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u, q_u->ptr_sid[0] = 1; make_dom_sid2(&q_u->sid[0], sid); } + + return True; } /******************************************************************* reads or writes a SAMR_Q_QUERY_USERALIASES structure. ********************************************************************/ -void samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES *q_u, prs_struct *ps, int depth) { fstring tmp; int i; - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_useraliases"); depth++; @@ -2994,16 +3251,18 @@ void samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES *q_u, prs } prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_USERALIASES structure. ********************************************************************/ -void make_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES *r_u, +BOOL make_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES *r_u, uint32 num_rids, uint32 *rid, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_useraliases\n")); @@ -3023,16 +3282,18 @@ void make_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES *r_u, prs_struct *ps, int depth) { fstring tmp; int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_useraliases"); depth++; @@ -3053,15 +3314,17 @@ void samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES *r_u, prs } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_OPEN_ALIAS structure. ********************************************************************/ -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, POLICY_HND *pol, +BOOL make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, POLICY_HND *pol, uint32 unknown_0, uint32 rid) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_open_alias\n")); @@ -3071,14 +3334,16 @@ void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, POLICY_HND *pol, q_u->unknown_0 = unknown_0; q_u->rid_alias = rid; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_open_alias"); depth++; @@ -3089,14 +3354,16 @@ void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, i prs_uint32("unknown_0", ps, depth, &(q_u->unknown_0)); prs_uint32("rid_alias", ps, depth, &(q_u->rid_alias)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_open_alias"); depth++; @@ -3107,17 +3374,19 @@ void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, i prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_LOOKUP_RIDS structure. ********************************************************************/ -void make_samr_q_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u, +BOOL make_samr_q_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u, POLICY_HND *pol, uint32 flags, uint32 num_rids, uint32 *rid) { int i; - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_r_unknwon_12\n")); @@ -3132,17 +3401,19 @@ void make_samr_q_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u, { q_u->rid[i] = rid[i]; } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, int depth) { int i; fstring tmp; - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_lookup_rids"); depth++; @@ -3167,18 +3438,20 @@ void samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, } prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_LOOKUP_RIDS structure. ********************************************************************/ -void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, +BOOL make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, uint32 num_names, fstring *name, uint8 *type, uint32 status) { int i; - if (r_u == NULL || name == NULL || type == NULL) return; + if (r_u == NULL || name == NULL || type == NULL) return False; DEBUG(5,("make_samr_r_lookup_rids\n")); @@ -3214,16 +3487,18 @@ void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, int depth) { int i; fstring tmp; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_lookup_rids"); depth++; @@ -3269,27 +3544,31 @@ void samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_OPEN_ALIAS structure. ********************************************************************/ -void make_samr_q_delete_alias(SAMR_Q_DELETE_DOM_ALIAS *q_u, POLICY_HND *hnd) +BOOL make_samr_q_delete_alias(SAMR_Q_DELETE_DOM_ALIAS *q_u, POLICY_HND *hnd) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_delete_alias\n")); memcpy(&(q_u->alias_pol), hnd, sizeof(q_u->alias_pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_delete_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_delete_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_delete_alias"); depth++; @@ -3297,14 +3576,16 @@ void samr_io_q_delete_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struc prs_align(ps); smb_io_pol_hnd("alias_pol", &(q_u->alias_pol), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_delete_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_delete_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_delete_alias"); depth++; @@ -3313,17 +3594,19 @@ void samr_io_r_delete_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struc smb_io_pol_hnd("pol", &(r_u->pol), ps, depth); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_CREATE_DOM_ALIAS structure. ********************************************************************/ -void make_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u, POLICY_HND *hnd, +BOOL make_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u, POLICY_HND *hnd, const char *acct_desc) { int acct_len = acct_desc != NULL ? strlen(acct_desc) : 0; - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_create_dom_alias\n")); @@ -3334,15 +3617,17 @@ void make_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u, POLICY_HND *hnd, q_u->unknown_1 = 0x001f; q_u->unknown_2 = 0x000f; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_create_dom_alias(char *desc, SAMR_Q_CREATE_DOM_ALIAS *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_create_dom_alias(char *desc, SAMR_Q_CREATE_DOM_ALIAS *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_create_dom_alias"); depth++; @@ -3356,30 +3641,34 @@ void samr_io_q_create_dom_alias(char *desc, SAMR_Q_CREATE_DOM_ALIAS *q_u, prs_s prs_uint16("unknown_1", ps, depth, &(q_u->unknown_1)); prs_uint16("unknown_2", ps, depth, &(q_u->unknown_2)); + + return True; } /******************************************************************* makes a SAMR_R_CREATE_DOM_ALIAS structure. ********************************************************************/ -void make_samr_r_create_dom_alias(SAMR_R_CREATE_DOM_ALIAS *r_u, POLICY_HND *pol, +BOOL make_samr_r_create_dom_alias(SAMR_R_CREATE_DOM_ALIAS *r_u, POLICY_HND *pol, uint32 rid, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_create_dom_alias\n")); memcpy(&(r_u->alias_pol), pol, sizeof(*pol)); r_u->rid = rid ; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_create_dom_alias(char *desc, SAMR_R_CREATE_DOM_ALIAS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_create_dom_alias(char *desc, SAMR_R_CREATE_DOM_ALIAS *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_create_dom_alias"); depth++; @@ -3390,6 +3679,8 @@ void samr_io_r_create_dom_alias(char *desc, SAMR_R_CREATE_DOM_ALIAS *r_u, prs_s prs_uint32("rid", ps, depth, &(r_u->rid)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } @@ -3397,24 +3688,26 @@ void samr_io_r_create_dom_alias(char *desc, SAMR_R_CREATE_DOM_ALIAS *r_u, prs_s /******************************************************************* makes a SAMR_Q_ADD_ALIASMEM structure. ********************************************************************/ -void make_samr_q_add_aliasmem(SAMR_Q_ADD_ALIASMEM *q_u, POLICY_HND *hnd, +BOOL make_samr_q_add_aliasmem(SAMR_Q_ADD_ALIASMEM *q_u, POLICY_HND *hnd, DOM_SID *sid) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_add_aliasmem\n")); memcpy(&(q_u->alias_pol), hnd, sizeof(q_u->alias_pol)); make_dom_sid2(&q_u->sid, sid); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_add_aliasmem(char *desc, SAMR_Q_ADD_ALIASMEM *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_add_aliasmem(char *desc, SAMR_Q_ADD_ALIASMEM *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_add_aliasmem"); depth++; @@ -3423,14 +3716,16 @@ void samr_io_q_add_aliasmem(char *desc, SAMR_Q_ADD_ALIASMEM *q_u, prs_struct *p smb_io_pol_hnd ("alias_pol", &(q_u->alias_pol), ps, depth); smb_io_dom_sid2("sid ", &(q_u->sid ), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_add_aliasmem(char *desc, SAMR_R_ADD_ALIASMEM *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_add_aliasmem(char *desc, SAMR_R_ADD_ALIASMEM *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_add_aliasmem"); depth++; @@ -3438,30 +3733,34 @@ void samr_io_r_add_aliasmem(char *desc, SAMR_R_ADD_ALIASMEM *r_u, prs_struct *p prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_DEL_ALIASMEM structure. ********************************************************************/ -void make_samr_q_del_aliasmem(SAMR_Q_DEL_ALIASMEM *q_u, POLICY_HND *hnd, +BOOL make_samr_q_del_aliasmem(SAMR_Q_DEL_ALIASMEM *q_u, POLICY_HND *hnd, DOM_SID *sid) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_del_aliasmem\n")); memcpy(&(q_u->alias_pol), hnd, sizeof(q_u->alias_pol)); make_dom_sid2(&q_u->sid, sid); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_del_aliasmem(char *desc, SAMR_Q_DEL_ALIASMEM *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_del_aliasmem(char *desc, SAMR_Q_DEL_ALIASMEM *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_del_aliasmem"); depth++; @@ -3470,14 +3769,16 @@ void samr_io_q_del_aliasmem(char *desc, SAMR_Q_DEL_ALIASMEM *q_u, prs_struct *p smb_io_pol_hnd("alias_pol", &(q_u->alias_pol), ps, depth); smb_io_dom_sid2("sid ", &(q_u->sid ), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_del_aliasmem(char *desc, SAMR_R_DEL_ALIASMEM *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_del_aliasmem(char *desc, SAMR_R_DEL_ALIASMEM *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_del_aliasmem"); depth++; @@ -3485,26 +3786,30 @@ void samr_io_r_del_aliasmem(char *desc, SAMR_R_DEL_ALIASMEM *r_u, prs_struct *p prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_DELETE_DOM_ALIAS structure. ********************************************************************/ -void make_samr_q_delete_dom_alias(SAMR_Q_DELETE_DOM_ALIAS *q_c, POLICY_HND *hnd) +BOOL make_samr_q_delete_dom_alias(SAMR_Q_DELETE_DOM_ALIAS *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_delete_dom_alias\n")); memcpy(&(q_c->alias_pol), hnd, sizeof(q_c->alias_pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_delete_dom_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_delete_dom_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_delete_dom_alias"); depth++; @@ -3512,27 +3817,31 @@ void samr_io_q_delete_dom_alias(char *desc, SAMR_Q_DELETE_DOM_ALIAS *q_u, prs_s prs_align(ps); smb_io_pol_hnd("alias_pol", &(q_u->alias_pol), ps, depth); + + return True; } /******************************************************************* makes a SAMR_R_DELETE_DOM_ALIAS structure. ********************************************************************/ -void make_samr_r_delete_dom_alias(SAMR_R_DELETE_DOM_ALIAS *r_u, +BOOL make_samr_r_delete_dom_alias(SAMR_R_DELETE_DOM_ALIAS *r_u, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_delete_dom_alias\n")); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_delete_dom_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_delete_dom_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_delete_dom_alias"); depth++; @@ -3540,27 +3849,31 @@ void samr_io_r_delete_dom_alias(char *desc, SAMR_R_DELETE_DOM_ALIAS *r_u, prs_s prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_ALIASMEM structure. ********************************************************************/ -void make_samr_q_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_c, POLICY_HND *hnd) +BOOL make_samr_q_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_query_aliasmem\n")); memcpy(&(q_c->alias_pol), hnd, sizeof(q_c->alias_pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_aliasmem(char *desc, SAMR_Q_QUERY_ALIASMEM *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_query_aliasmem(char *desc, SAMR_Q_QUERY_ALIASMEM *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_aliasmem"); depth++; @@ -3568,15 +3881,17 @@ void samr_io_q_query_aliasmem(char *desc, SAMR_Q_QUERY_ALIASMEM *q_u, prs_struc prs_align(ps); smb_io_pol_hnd("alias_pol", &(q_u->alias_pol), ps, depth); + + return True; } /******************************************************************* makes a SAMR_R_QUERY_ALIASMEM structure. ********************************************************************/ -void make_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM *r_u, +BOOL make_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM *r_u, uint32 num_sids, DOM_SID2 *sid, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_query_aliasmem\n")); @@ -3595,17 +3910,19 @@ void make_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struct *ps, int depth) { int i; uint32 ptr_sid[MAX_LOOKUP_SIDS]; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_aliasmem"); depth++; @@ -3640,17 +3957,19 @@ void samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struc } } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_LOOKUP_NAMES structure. ********************************************************************/ -void make_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, +BOOL make_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, POLICY_HND *pol, uint32 flags, uint32 num_names, const char **name) { int i; - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_lookup_names\n")); @@ -3667,17 +3986,19 @@ void make_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, make_uni_hdr(&(q_u->hdr_name[i]), len_name); /* unicode header for user_name */ make_unistr2(&(q_u->uni_name[i]), name[i], len_name); /* unicode string for machine account */ } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth) { int i; - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_lookup_names"); depth++; @@ -3706,17 +4027,19 @@ void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *p } prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_LOOKUP_NAMES structure. ********************************************************************/ -void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, +BOOL make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, uint32 num_rids, uint32 *rid, uint8 *type, uint32 status) { int i; - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_lookup_names\n")); @@ -3750,17 +4073,19 @@ void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, } r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth) { int i; fstring tmp; - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_lookup_names"); depth++; @@ -3777,7 +4102,7 @@ void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *p if (r_u->num_rids2 != r_u->num_rids1) { /* RPC fault */ - return; + return False; } for (i = 0; i < r_u->num_rids2; i++) @@ -3798,7 +4123,7 @@ void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *p if (r_u->num_types2 != r_u->num_types1) { /* RPC fault */ - return; + return False; } for (i = 0; i < r_u->num_types2; i++) @@ -3810,17 +4135,19 @@ void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *p } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, +BOOL make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, POLICY_HND *pol, uint32 unk_0, uint32 rid) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("samr_make_samr_q_open_user\n")); @@ -3828,14 +4155,16 @@ void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, q_u->unknown_0 = unk_0; q_u->user_rid = rid; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_open_user"); depth++; @@ -3849,14 +4178,16 @@ void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int prs_uint32("user_rid ", ps, depth, &(q_u->user_rid )); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_open_user"); depth++; @@ -3867,18 +4198,20 @@ void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_create_user(SAMR_Q_CREATE_USER *q_u, +BOOL make_samr_q_create_user(SAMR_Q_CREATE_USER *q_u, POLICY_HND *pol, const char *name, uint16 acb_info, uint32 unk_1) { int len_name; - if (q_u == NULL) return; + if (q_u == NULL) return False; len_name = strlen(name); DEBUG(5,("samr_make_samr_q_create_user\n")); @@ -3890,14 +4223,16 @@ void make_samr_q_create_user(SAMR_Q_CREATE_USER *q_u, q_u->acb_info = acb_info; q_u->unknown_1 = unk_1; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_create_user(char *desc, SAMR_Q_CREATE_USER *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_create_user(char *desc, SAMR_Q_CREATE_USER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_create_user"); depth++; @@ -3916,17 +4251,19 @@ void samr_io_q_create_user(char *desc, SAMR_Q_CREATE_USER *q_u, prs_struct *ps, prs_uint32("unknown_1", ps, depth, &(q_u->unknown_1)); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_r_create_user(SAMR_R_CREATE_USER *r_u, +BOOL make_samr_r_create_user(SAMR_R_CREATE_USER *r_u, POLICY_HND *user_pol, uint32 unk_0, uint32 user_rid, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("samr_make_samr_r_create_user\n")); @@ -3935,14 +4272,16 @@ void make_samr_r_create_user(SAMR_R_CREATE_USER *r_u, r_u->unknown_0 = unk_0; r_u->user_rid = user_rid; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_create_user(char *desc, SAMR_R_CREATE_USER *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_create_user(char *desc, SAMR_R_CREATE_USER *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_create_user"); depth++; @@ -3955,29 +4294,33 @@ void samr_io_r_create_user(char *desc, SAMR_R_CREATE_USER *r_u, prs_struct *ps, prs_uint32("unknown_0", ps, depth, &(r_u->unknown_0)); prs_uint32("user_rid ", ps, depth, &(r_u->user_rid )); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_QUERY_USERINFO structure. ********************************************************************/ -void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, +BOOL make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, POLICY_HND *hnd, uint16 switch_value) { - if (q_u == NULL || hnd == NULL) return; + if (q_u == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_query_userinfo\n")); memcpy(&(q_u->pol), hnd, sizeof(q_u->pol)); q_u->switch_value = switch_value; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_query_userinfo"); depth++; @@ -3990,14 +4333,16 @@ void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struc prs_uint16("switch_value", ps, depth, &(q_u->switch_value)); /* 0x0015 or 0x0011 */ prs_align(ps); + + return True; } /******************************************************************* reads or writes a LOGON_HRS structure. ********************************************************************/ -static void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth) +static BOOL sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth) { - if (hrs == NULL) return; + if (hrs == NULL) return False; prs_debug(ps, depth, desc, "sam_io_logon_hrs"); depth++; @@ -4013,27 +4358,31 @@ static void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int de } prs_uint8s (False, "hours", ps, depth, hrs->hours, hrs->len); + + return True; } /******************************************************************* makes a SAM_USER_INFO_10 structure. ********************************************************************/ -void make_sam_user_info10(SAM_USER_INFO_10 *usr, +BOOL make_sam_user_info10(SAM_USER_INFO_10 *usr, uint32 acb_info) { - if (usr == NULL) return; + if (usr == NULL) return False; DEBUG(5,("make_sam_user_info10\n")); usr->acb_info = acb_info; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_user_info10(char *desc, SAM_USER_INFO_10 *usr, prs_struct *ps, int depth) +BOOL sam_io_user_info10(char *desc, SAM_USER_INFO_10 *usr, prs_struct *ps, int depth) { - if (usr == NULL) return; + if (usr == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_user_info10"); depth++; @@ -4041,12 +4390,14 @@ void sam_io_user_info10(char *desc, SAM_USER_INFO_10 *usr, prs_struct *ps, int prs_align(ps); prs_uint32("acb_info", ps, depth, &(usr->acb_info)); + + return True; } /******************************************************************* makes a SAM_USER_INFO_11 structure. ********************************************************************/ -void make_sam_user_info11(SAM_USER_INFO_11 *usr, +BOOL make_sam_user_info11(SAM_USER_INFO_11 *usr, NTTIME *expiry, char *mach_acct, uint32 rid_user, @@ -4055,7 +4406,7 @@ void make_sam_user_info11(SAM_USER_INFO_11 *usr, { int len_mach_acct; - if (usr == NULL || expiry == NULL || mach_acct == NULL) return; + if (usr == NULL || expiry == NULL || mach_acct == NULL) return False; DEBUG(5,("make_sam_user_info11\n")); @@ -4090,14 +4441,16 @@ void make_sam_user_info11(SAM_USER_INFO_11 *usr, usr->padding_8 = 0; /* 0 - padding 4 bytes */ make_unistr2(&(usr->uni_mach_acct), mach_acct, len_mach_acct); /* unicode string for machine account */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth) +BOOL sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth) { - if (usr == NULL) return; + if (usr == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_unknown_24"); depth++; @@ -4137,6 +4490,8 @@ void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int prs_align(ps); prs_uint8s (False, "padding_9", ps, depth, usr->padding_9, sizeof(usr->padding_9)); + + return True; } /************************************************************************* @@ -4147,18 +4502,20 @@ void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int unknown_6 = 0x0000 04ec *************************************************************************/ -void make_sam_user_info24(SAM_USER_INFO_24 *usr, +BOOL make_sam_user_info24(SAM_USER_INFO_24 *usr, char newpass[516]) { memcpy(usr->pass, newpass, sizeof(usr->pass)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_user_info24(char *desc, SAM_USER_INFO_24 *usr, prs_struct *ps, int depth) +static BOOL sam_io_user_info24(char *desc, SAM_USER_INFO_24 *usr, prs_struct *ps, int depth) { - if (usr == NULL) return; + if (usr == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_user_info"); depth++; @@ -4167,6 +4524,8 @@ static void sam_io_user_info24(char *desc, SAM_USER_INFO_24 *usr, prs_struct *p prs_uint8s (False, "password", ps, depth, usr->pass, sizeof(usr->pass)); prs_align(ps); + + return True; } @@ -4178,7 +4537,7 @@ static void sam_io_user_info24(char *desc, SAM_USER_INFO_24 *usr, prs_struct *p unknown_6 = 0x0000 04ec *************************************************************************/ -void make_sam_user_info23(SAM_USER_INFO_23 *usr, +BOOL make_sam_user_info23(SAM_USER_INFO_23 *usr, NTTIME *logon_time, /* all zeros */ NTTIME *logoff_time, /* all zeros */ @@ -4277,14 +4636,16 @@ void make_sam_user_info23(SAM_USER_INFO_23 *usr, { memset(&(usr->logon_hrs), 0xff, sizeof(usr->logon_hrs)); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_user_info23(char *desc, SAM_USER_INFO_23 *usr, prs_struct *ps, int depth) +static BOOL sam_io_user_info23(char *desc, SAM_USER_INFO_23 *usr, prs_struct *ps, int depth) { - if (usr == NULL) return; + if (usr == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_user_info"); depth++; @@ -4347,6 +4708,8 @@ static void sam_io_user_info23(char *desc, SAM_USER_INFO_23 *usr, prs_struct *p sam_io_logon_hrs("logon_hrs", &(usr->logon_hrs) , ps, depth); prs_align(ps); } + + return True; } @@ -4358,7 +4721,7 @@ static void sam_io_user_info23(char *desc, SAM_USER_INFO_23 *usr, prs_struct *p unknown_6 = 0x0000 04ec *************************************************************************/ -void make_sam_user_info21(SAM_USER_INFO_21 *usr, +BOOL make_sam_user_info21(SAM_USER_INFO_21 *usr, NTTIME *logon_time, NTTIME *logoff_time, @@ -4453,15 +4816,17 @@ void make_sam_user_info21(SAM_USER_INFO_21 *usr, { memset(&(usr->logon_hrs), 0xff, sizeof(usr->logon_hrs)); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth) +static BOOL sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth) { - if (usr == NULL) return; + if (usr == NULL) return False; prs_debug(ps, depth, desc, "lsa_io_user_info"); depth++; @@ -4523,17 +4888,19 @@ static void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *p sam_io_logon_hrs("logon_hrs", &(usr->logon_hrs) , ps, depth); prs_align(ps); } + + return True; } /******************************************************************* makes a SAMR_R_QUERY_USERINFO structure. ********************************************************************/ -void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, +BOOL make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, uint16 switch_value, void *info, uint32 status) { - if (r_u == NULL || info == NULL) return; + if (r_u == NULL || info == NULL) return False; DEBUG(5,("make_samr_r_query_userinfo\n")); @@ -4595,14 +4962,16 @@ void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, } r_u->status = status; /* return status */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_userinfo"); depth++; @@ -4626,7 +4995,7 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc else { DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n")); - return; + return False; } break; } @@ -4640,7 +5009,7 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc else { DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n")); - return; + return False; } break; } @@ -4654,7 +5023,7 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc else { DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n")); - return; + return False; } break; } @@ -4667,7 +5036,7 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc else { DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n")); - return; + return False; } break; } @@ -4680,7 +5049,7 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc else { DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n")); - return; + return False; } break; } @@ -4694,16 +5063,18 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc } prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_SET_USERINFO structure. ********************************************************************/ -void make_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u, +BOOL make_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u, POLICY_HND *hnd, uint16 switch_value, void *info) { - if (q_u == NULL || hnd == NULL) return; + if (q_u == NULL || hnd == NULL) return False; DEBUG(5,("make_samr_q_set_userinfo\n")); @@ -4733,15 +5104,17 @@ void make_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u, break; } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_set_userinfo"); depth++; @@ -4768,7 +5141,7 @@ void samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps if (q_u->info.id == NULL) { DEBUG(2,("samr_io_q_query_userinfo: info pointer not initialised\n")); - return; + return False; } sam_io_user_info24("", q_u->info.id24, ps, depth); break; @@ -4779,7 +5152,7 @@ void samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps if (q_u->info.id == NULL) { DEBUG(2,("samr_io_q_query_userinfo: info pointer not initialised\n")); - return; + return False; } sam_io_user_info23("", q_u->info.id23, ps, depth); break; @@ -4792,27 +5165,31 @@ void samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps } prs_align(ps); + + return True; } /******************************************************************* makes a SAMR_R_SET_USERINFO structure. ********************************************************************/ -void make_samr_r_set_userinfo(SAMR_R_SET_USERINFO *r_u, uint32 status) +BOOL make_samr_r_set_userinfo(SAMR_R_SET_USERINFO *r_u, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_samr_r_set_userinfo\n")); r_u->status = status; /* return status */ + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_set_userinfo(char *desc, SAMR_R_SET_USERINFO *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_set_userinfo(char *desc, SAMR_R_SET_USERINFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_set_userinfo"); depth++; @@ -4820,17 +5197,19 @@ void samr_io_r_set_userinfo(char *desc, SAMR_R_SET_USERINFO *r_u, prs_struct *p prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_CONNECT structure. ********************************************************************/ -void make_samr_q_connect(SAMR_Q_CONNECT *q_u, +BOOL make_samr_q_connect(SAMR_Q_CONNECT *q_u, char *srv_name, uint32 unknown_0) { int len_srv_name = strlen(srv_name); - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_connect\n")); @@ -4840,15 +5219,17 @@ void make_samr_q_connect(SAMR_Q_CONNECT *q_u, /* example values: 0x0000 0002 */ q_u->unknown_0 = unknown_0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_connect"); depth++; @@ -4861,14 +5242,16 @@ void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int dep prs_align(ps); prs_uint32("unknown_0 ", ps, depth, &(q_u->unknown_0 )); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_connect"); depth++; @@ -4879,14 +5262,16 @@ void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int dep prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_CONNECT_ANON structure. ********************************************************************/ -void make_samr_q_connect_anon(SAMR_Q_CONNECT_ANON *q_u) +BOOL make_samr_q_connect_anon(SAMR_Q_CONNECT_ANON *q_u) { - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_connect_anon\n")); @@ -4894,15 +5279,17 @@ void make_samr_q_connect_anon(SAMR_Q_CONNECT_ANON *q_u) q_u->unknown_0 = 0x5c; /* server name (?!!) */ q_u->unknown_1 = 0x01; q_u->unknown_2 = 0x20; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_connect_anon(char *desc, SAMR_Q_CONNECT_ANON *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_connect_anon(char *desc, SAMR_Q_CONNECT_ANON *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_connect_anon"); depth++; @@ -4913,14 +5300,16 @@ void samr_io_q_connect_anon(char *desc, SAMR_Q_CONNECT_ANON *q_u, prs_struct *p prs_uint16("unknown_0", ps, depth, &(q_u->unknown_0)); prs_uint16("unknown_1", ps, depth, &(q_u->unknown_1)); prs_uint32("unknown_2", ps, depth, &(q_u->unknown_2)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_connect_anon(char *desc, SAMR_R_CONNECT_ANON *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_connect_anon(char *desc, SAMR_R_CONNECT_ANON *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_connect_anon"); depth++; @@ -4931,16 +5320,18 @@ void samr_io_r_connect_anon(char *desc, SAMR_R_CONNECT_ANON *r_u, prs_struct *p prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* makes a SAMR_Q_UNKNOWN_38 structure. ********************************************************************/ -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name) +BOOL make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name) { int len_srv_name = strlen(srv_name); - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_unknown_38\n")); @@ -4948,14 +5339,16 @@ void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name) make_uni_hdr(&(q_u->hdr_srv_name), len_srv_name); make_unistr2(&(q_u->uni_srv_name), srv_name, len_srv_name); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_unknown_38"); depth++; @@ -4968,14 +5361,16 @@ void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, i smb_io_unihdr ("", &(q_u->hdr_srv_name), ps, depth); smb_io_unistr2("", &(q_u->uni_srv_name), q_u->hdr_srv_name.buffer, ps, depth); } + + return True; } /******************************************************************* makes a SAMR_R_UNKNOWN_38 structure. ********************************************************************/ -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u) +BOOL make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_r_unknown_38\n")); @@ -4983,14 +5378,16 @@ void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u) r_u->unk_1 = 0; r_u->unk_2 = 0; r_u->unk_3 = 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_unknown_38"); depth++; @@ -5005,25 +5402,29 @@ void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, i prs_align(ps); prs_uint16("unk_3", ps, depth, &(r_u->unk_3)); prs_align(ps); + + return True; } /******************************************************************* make a SAMR_ENC_PASSWD structure. ********************************************************************/ -void make_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]) +BOOL make_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]) { - if (pwd == NULL) return; + if (pwd == NULL) return False; pwd->ptr = 1; memcpy(pwd->pass, pass, sizeof(pwd->pass)); + + return True; } /******************************************************************* reads or writes a SAMR_ENC_PASSWD structure. ********************************************************************/ -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth) +BOOL samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth) { - if (pwd == NULL) return; + if (pwd == NULL) return False; prs_debug(ps, depth, desc, "samr_io_enc_passwd"); depth++; @@ -5032,25 +5433,29 @@ void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int de prs_uint32("ptr", ps, depth, &(pwd->ptr)); prs_uint8s(False, "pwd", ps, depth, pwd->pass, sizeof(pwd->pass)); + + return True; } /******************************************************************* makes a SAMR_ENC_HASH structure. ********************************************************************/ -void make_enc_hash(SAMR_ENC_HASH *hsh, uchar hash[16]) +BOOL make_enc_hash(SAMR_ENC_HASH *hsh, uchar hash[16]) { - if (hsh == NULL) return; + if (hsh == NULL) return False; hsh->ptr = 1; memcpy(hsh->hash, hash, sizeof(hsh->hash)); + + return True; } /******************************************************************* reads or writes a SAMR_ENC_HASH structure. ********************************************************************/ -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth) +BOOL samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth) { - if (hsh == NULL) return; + if (hsh == NULL) return False; prs_debug(ps, depth, desc, "samr_io_enc_hash"); depth++; @@ -5059,12 +5464,14 @@ void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth) prs_uint32("ptr ", ps, depth, &(hsh->ptr)); prs_uint8s(False, "hash", ps, depth, hsh->hash, sizeof(hsh->hash)); + + return True; } /******************************************************************* makes a SAMR_R_UNKNOWN_38 structure. ********************************************************************/ -void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, +BOOL make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, char *dest_host, char *user_name, char nt_newpass[516], uchar nt_oldhash[16], char lm_newpass[516], uchar lm_oldhash[16]) @@ -5072,7 +5479,7 @@ void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, int len_dest_host = strlen(dest_host); int len_user_name = strlen(user_name); - if (q_u == NULL) return; + if (q_u == NULL) return False; DEBUG(5,("make_samr_q_chgpasswd_user\n")); @@ -5089,14 +5496,16 @@ void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, make_enc_passwd(&(q_u->lm_newpass), lm_newpass); make_enc_hash (&(q_u->lm_oldhash), lm_oldhash); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth) +BOOL samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_q_chgpasswd_user"); depth++; @@ -5122,26 +5531,30 @@ void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct samr_io_enc_passwd("lm_newpass", &(q_u->lm_newpass), ps, depth); prs_grow(ps); samr_io_enc_hash ("lm_oldhash", &(q_u->lm_oldhash), ps, depth); + + return True; } /******************************************************************* makes a SAMR_R_CHGPASSWD_USER structure. ********************************************************************/ -void make_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER *r_u, uint32 status) +BOOL make_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER *r_u, uint32 status) { - if (r_u == NULL) return; + if (r_u == NULL) return False; DEBUG(5,("make_r_chgpasswd_user\n")); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth) +BOOL samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_chgpasswd_user"); depth++; @@ -5149,6 +5562,8 @@ void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c index 2840070edc..c7d4d09612 100644 --- a/source3/rpc_parse/parse_sec.c +++ b/source3/rpc_parse/parse_sec.c @@ -2,10 +2,10 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1998, - * Copyright (C) Jeremy R. Allison 1995-1998 - * Copyright (C) Luke Kenneth Casson Leighton 1996-1998, - * Copyright (C) Paul Ashton 1997-1998. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Jeremy R. Allison 1995-1999 + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,17 +31,19 @@ extern int DEBUGLEVEL; /******************************************************************* makes a structure. ********************************************************************/ -void make_sec_access(SEC_ACCESS *t, uint32 mask) +BOOL make_sec_access(SEC_ACCESS *t, uint32 mask) { t->mask = mask; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sec_io_access(char *desc, SEC_ACCESS *t, prs_struct *ps, int depth) - { - if (t == NULL) return; +BOOL sec_io_access(char *desc, SEC_ACCESS *t, prs_struct *ps, int depth) +{ + if (t == NULL) return False; prs_debug(ps, depth, desc, "sec_io_access"); depth++; @@ -49,13 +51,15 @@ void sec_io_access(char *desc, SEC_ACCESS *t, prs_struct *ps, int depth) prs_align(ps); prs_uint32("mask", ps, depth, &(t->mask)); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_sec_ace(SEC_ACE *t, DOM_SID *sid, uint8 type, SEC_ACCESS mask, uint8 flag) +BOOL make_sec_ace(SEC_ACE *t, DOM_SID *sid, uint8 type, SEC_ACCESS mask, uint8 flag) { t->type = type; t->flags = flag; @@ -63,16 +67,18 @@ void make_sec_ace(SEC_ACE *t, DOM_SID *sid, uint8 type, SEC_ACCESS mask, uint8 f t->info = mask; sid_copy(&t->sid, sid); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void sec_io_ace(char *desc, SEC_ACE *t, prs_struct *ps, int depth) +BOOL sec_io_ace(char *desc, SEC_ACE *t, prs_struct *ps, int depth) { uint32 old_offset; uint32 offset_ace_size; - if (t == NULL) return; + if (t == NULL) return False; prs_debug(ps, depth, desc, "sec_io_ace"); depth++; @@ -90,12 +96,14 @@ void sec_io_ace(char *desc, SEC_ACE *t, prs_struct *ps, int depth) smb_io_dom_sid("sid ", &t->sid , ps, depth); prs_uint16_post("size ", ps, depth, &t->size, offset_ace_size, old_offset); + + return True; } /******************************************************************* makes a structure. ********************************************************************/ -void make_sec_acl(SEC_ACL *t, uint16 revision, int num_aces, SEC_ACE *ace) +BOOL make_sec_acl(SEC_ACL *t, uint16 revision, int num_aces, SEC_ACE *ace) { int i; t->revision = revision; @@ -107,6 +115,8 @@ void make_sec_acl(SEC_ACL *t, uint16 revision, int num_aces, SEC_ACE *ace) { t->size += ace[i].size; } + + return True; } /******************************************************************* @@ -126,13 +136,13 @@ reads or writes a structure. first of the xx_io_xx functions that allocates its data structures for you as it reads them. ********************************************************************/ -void sec_io_acl(char *desc, SEC_ACL *t, prs_struct *ps, int depth) +BOOL sec_io_acl(char *desc, SEC_ACL *t, prs_struct *ps, int depth) { int i; uint32 old_offset; uint32 offset_acl_size; - if (t == NULL) return; + if (t == NULL) return False; prs_debug(ps, depth, desc, "sec_io_acl"); depth++; @@ -156,7 +166,7 @@ void sec_io_acl(char *desc, SEC_ACL *t, prs_struct *ps, int depth) { DEBUG(0,("INVALID ACL\n")); ps->offset = 0xfffffffe; - return; + return False; } for (i = 0; i < MIN(t->num_aces, MAX_SEC_ACES); i++) @@ -169,6 +179,8 @@ void sec_io_acl(char *desc, SEC_ACL *t, prs_struct *ps, int depth) prs_align(ps); prs_uint16_post("size ", ps, depth, &t->size , offset_acl_size, old_offset); + + return True; } @@ -253,7 +265,8 @@ void free_sec_desc(SEC_DESC *t) if (t->sacl != NULL) { free_sec_acl(t->dacl); -} + + } if (t->owner_sid != NULL) { @@ -261,7 +274,7 @@ void free_sec_desc(SEC_DESC *t) } if (t->grp_sid != NULL) -{ + { free(t->grp_sid); } } @@ -270,7 +283,7 @@ void free_sec_desc(SEC_DESC *t) /******************************************************************* reads or writes a structure. ********************************************************************/ -static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) +static BOOL sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) { #if 0 uint32 off_owner_sid; @@ -281,7 +294,7 @@ static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) uint32 old_offset; uint32 max_offset = 0; /* after we're done, move offset to end */ - if (t == NULL) return; + if (t == NULL) return False; prs_debug(ps, depth, desc, "sec_io_desc"); depth++; @@ -317,13 +330,13 @@ static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) /* reading */ t->dacl = malloc(sizeof(*t->dacl)); ZERO_STRUCTP(t->dacl); - } + } if (t->dacl == NULL) { DEBUG(0,("INVALID DACL\n")); ps->offset = 0xfffffffe; - return; + return False; } sec_io_acl ("dacl" , t->dacl , ps, depth); @@ -355,7 +368,7 @@ static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) { DEBUG(0,("INVALID SACL\n")); ps->offset = 0xfffffffe; - return; + return False; } sec_io_acl ("sacl" , t->sacl , ps, depth); @@ -390,7 +403,7 @@ static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) { DEBUG(0,("INVALID OWNER SID\n")); ps->offset = 0xfffffffe; - return; + return False; } smb_io_dom_sid("owner_sid ", t->owner_sid , ps, depth); @@ -407,20 +420,21 @@ static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) if (ps->io) { ps->offset = old_offset + t->off_grp_sid; -} + + } if (ps->io) -{ + { /* reading */ t->grp_sid = malloc(sizeof(*t->grp_sid)); ZERO_STRUCTP(t->grp_sid); } if (t->grp_sid == NULL) - { + { DEBUG(0,("INVALID GROUP SID\n")); ps->offset = 0xfffffffe; - return; - } + return False; + } smb_io_dom_sid("grp_sid", t->grp_sid, ps, depth); prs_align(ps); @@ -429,13 +443,15 @@ static void sec_io_desc(char *desc, SEC_DESC *t, prs_struct *ps, int depth) max_offset = MAX(max_offset, ps->offset); ps->offset = max_offset; + + return True; } /******************************************************************* creates a SEC_DESC_BUF structure. ********************************************************************/ -void make_sec_desc_buf(SEC_DESC_BUF *buf, int len, SEC_DESC *data) - { +BOOL make_sec_desc_buf(SEC_DESC_BUF *buf, int len, SEC_DESC *data) +{ ZERO_STRUCTP(buf); /* max buffer size (allocated size) */ @@ -443,6 +459,8 @@ void make_sec_desc_buf(SEC_DESC_BUF *buf, int len, SEC_DESC *data) buf->undoc = 0; buf->len = data != NULL ? len : 0; buf->sec = data; + + return True; } /******************************************************************* @@ -461,14 +479,14 @@ void free_sec_desc_buf(SEC_DESC_BUF *buf) /******************************************************************* reads or writes a SEC_DESC_BUF structure. ********************************************************************/ -void sec_io_desc_buf(char *desc, SEC_DESC_BUF *sec, prs_struct *ps, int depth) +BOOL sec_io_desc_buf(char *desc, SEC_DESC_BUF *sec, prs_struct *ps, int depth) { uint32 off_len; uint32 off_max_len; uint32 old_offset; uint32 size; - if (sec == NULL) return; + if (sec == NULL) return False; prs_debug(ps, depth, desc, "sec_io_desc_buf"); depth++; @@ -491,7 +509,7 @@ void sec_io_desc_buf(char *desc, SEC_DESC_BUF *sec, prs_struct *ps, int depth) { DEBUG(0,("INVALID SEC_DESC\n")); ps->offset = 0xfffffffe; - return; + return False; } } @@ -504,5 +522,7 @@ void sec_io_desc_buf(char *desc, SEC_DESC_BUF *sec, prs_struct *ps, int depth) size = ps->offset - old_offset; prs_uint32_post("max_len", ps, depth, &(sec->max_len), off_max_len, size == 0 ? sec->max_len : size); prs_uint32_post("len ", ps, depth, &(sec->len ), off_len , size); + + return True; } diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index c66d176c78..c11c1ed43c 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -45,7 +45,7 @@ static uint32 str_len_uni(UNISTR *source) /******************************************************************* This should be moved in a more generic lib. ********************************************************************/ -static void spoolss_io_system_time(char *desc, prs_struct *ps, int depth, SYSTEMTIME *systime) +static BOOL spoolss_io_system_time(char *desc, prs_struct *ps, int depth, SYSTEMTIME *systime) { prs_uint16("year", ps, depth, &(systime->year)); prs_uint16("month", ps, depth, &(systime->month)); @@ -55,11 +55,13 @@ static void spoolss_io_system_time(char *desc, prs_struct *ps, int depth, SYSTEM prs_uint16("minute", ps, depth, &(systime->minute)); prs_uint16("second", ps, depth, &(systime->second)); prs_uint16("milliseconds", ps, depth, &(systime->milliseconds)); + + return True; } /******************************************************************* ********************************************************************/ -void make_systemtime(SYSTEMTIME *systime, struct tm *unixtime) +BOOL make_systemtime(SYSTEMTIME *systime, struct tm *unixtime) { systime->year=unixtime->tm_year+1900; systime->month=unixtime->tm_mon+1; @@ -69,14 +71,16 @@ void make_systemtime(SYSTEMTIME *systime, struct tm *unixtime) systime->minute=unixtime->tm_min; systime->second=unixtime->tm_sec; systime->milliseconds=0; + + return True; } /******************************************************************* reads or writes an PRINTER_HND structure. ********************************************************************/ -static void smb_io_prt_hnd(char *desc, PRINTER_HND *hnd, prs_struct *ps, int depth) +static BOOL smb_io_prt_hnd(char *desc, PRINTER_HND *hnd, prs_struct *ps, int depth) { - if (hnd == NULL) return; + if (hnd == NULL) return False; prs_debug(ps, depth, desc, "smb_io_prt_hnd"); depth++; @@ -84,14 +88,16 @@ static void smb_io_prt_hnd(char *desc, PRINTER_HND *hnd, prs_struct *ps, int dep prs_align(ps); prs_uint8s (False, "data", ps, depth, hnd->data, PRINTER_HND_SIZE); + + return True; } /******************************************************************* reads or writes an DOC_INFO structure. ********************************************************************/ -static void smb_io_doc_info_1(char *desc, DOC_INFO_1 *info_1, prs_struct *ps, int depth) +static BOOL smb_io_doc_info_1(char *desc, DOC_INFO_1 *info_1, prs_struct *ps, int depth) { - if (info_1 == NULL) return; + if (info_1 == NULL) return False; prs_debug(ps, depth, desc, "smb_io_doc_info_1"); depth++; @@ -105,16 +111,18 @@ static void smb_io_doc_info_1(char *desc, DOC_INFO_1 *info_1, prs_struct *ps, in smb_io_unistr2("", &(info_1->docname), info_1->p_docname, ps, depth); smb_io_unistr2("", &(info_1->outputfile), info_1->p_outputfile, ps, depth); smb_io_unistr2("", &(info_1->datatype), info_1->p_datatype, ps, depth); + + return True; } /******************************************************************* reads or writes an DOC_INFO structure. ********************************************************************/ -static void smb_io_doc_info(char *desc, DOC_INFO *info, prs_struct *ps, int depth) +static BOOL smb_io_doc_info(char *desc, DOC_INFO *info, prs_struct *ps, int depth) { uint32 useless_ptr=0; - if (info == NULL) return; + if (info == NULL) return False; prs_debug(ps, depth, desc, "smb_io_doc_info"); depth++; @@ -147,14 +155,16 @@ static void smb_io_doc_info(char *desc, DOC_INFO *info, prs_struct *ps, int dept DEBUG(0,("Something is obviously wrong somewhere !\n")); break; } + + return True; } /******************************************************************* reads or writes an DOC_INFO_CONTAINER structure. ********************************************************************/ -static void smb_io_doc_info_container(char *desc, DOC_INFO_CONTAINER *cont, prs_struct *ps, int depth) +static BOOL smb_io_doc_info_container(char *desc, DOC_INFO_CONTAINER *cont, prs_struct *ps, int depth) { - if (cont == NULL) return; + if (cont == NULL) return False; prs_debug(ps, depth, desc, "smb_io_doc_info_container"); depth++; @@ -164,12 +174,14 @@ static void smb_io_doc_info_container(char *desc, DOC_INFO_CONTAINER *cont, prs_ prs_uint32("level", ps, depth, &(cont->level)); smb_io_doc_info("",&(cont->docinfo), ps, depth); + + return True; } /******************************************************************* reads or writes an NOTIFY OPTION TYPE structure. ********************************************************************/ -static void smb_io_notify_option_type(char *desc, +static BOOL smb_io_notify_option_type(char *desc, SPOOL_NOTIFY_OPTION_TYPE *type, prs_struct *ps, int depth) { @@ -187,12 +199,14 @@ static void smb_io_notify_option_type(char *desc, prs_uint32("count", ps, depth, &(type->count)); prs_uint32("useless ptr", ps, depth, &useless_ptr); + + return True; } /******************************************************************* reads or writes an NOTIFY OPTION TYPE DATA. ********************************************************************/ -static void smb_io_notify_option_type_data(char *desc, +static BOOL smb_io_notify_option_type_data(char *desc, SPOOL_NOTIFY_OPTION_TYPE *type, prs_struct *ps, int depth) { @@ -216,12 +230,14 @@ static void smb_io_notify_option_type_data(char *desc, /* read the option type struct */ prs_uint16("fields",ps,depth,&(type->fields[i])); } + + return True; } /******************************************************************* reads or writes an NOTIFY OPTION structure. ********************************************************************/ -static void smb_io_notify_option(char *desc, SPOOL_NOTIFY_OPTION *option, +static BOOL smb_io_notify_option(char *desc, SPOOL_NOTIFY_OPTION *option, prs_struct *ps, int depth) { uint32 useless_ptr; @@ -253,13 +269,15 @@ static void smb_io_notify_option(char *desc, SPOOL_NOTIFY_OPTION *option, smb_io_notify_option_type_data("",&(option->type[i]) ,ps, depth); } + + return True; } /******************************************************************* reads or writes an NOTIFY INFO DATA structure. ********************************************************************/ -static void smb_io_notify_info_data(char *desc,SPOOL_NOTIFY_INFO_DATA *data, +static BOOL smb_io_notify_info_data(char *desc,SPOOL_NOTIFY_INFO_DATA *data, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; @@ -304,12 +322,14 @@ static void smb_io_notify_info_data(char *desc,SPOOL_NOTIFY_INFO_DATA *data, prs_uint32("pointer", ps, depth, &useless_ptr); /*prs_align(ps);*/ } + + return True; } /******************************************************************* reads or writes an NOTIFY INFO DATA structure. ********************************************************************/ -void smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data, +BOOL smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data, prs_struct *ps, int depth) { uint32 x; @@ -329,12 +349,14 @@ void smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data, prs_uint16s(True,"string",ps,depth,data->notify_data.data.string,x); } prs_align(ps); + + return True; } /******************************************************************* reads or writes an NOTIFY INFO structure. ********************************************************************/ -static void smb_io_notify_info(char *desc, SPOOL_NOTIFY_INFO *info, +static BOOL smb_io_notify_info(char *desc, SPOOL_NOTIFY_INFO *info, prs_struct *ps, int depth) { uint32 useless_ptr=0x0001; @@ -365,15 +387,17 @@ static void smb_io_notify_info(char *desc, SPOOL_NOTIFY_INFO *info, smb_io_notify_info_data_strings(desc, &(info->data[i]), ps, depth); } + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_open_printer (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_open_printer(char *desc, SPOOL_R_OPEN_PRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_open_printer(char *desc, SPOOL_R_OPEN_PRINTER *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_r_open_printer"); depth++; @@ -385,15 +409,17 @@ void spoolss_io_r_open_printer(char *desc, SPOOL_R_OPEN_PRINTER *r_u, prs_struct prs_uint32("status code", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_open_printer (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_open_printer(char *desc, SPOOL_Q_OPEN_PRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_open_printer(char *desc, SPOOL_Q_OPEN_PRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_open_printer"); depth++; @@ -427,15 +453,17 @@ void spoolss_io_q_open_printer(char *desc, SPOOL_Q_OPEN_PRINTER *q_u, prs_struct smb_io_unistr2("", &(q_u->station),True,ps,depth); prs_align(ps); smb_io_unistr2("", &(q_u->username),True,ps,depth); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_getprinterdata (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_getprinterdata"); depth++; @@ -446,15 +474,17 @@ void spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_st smb_io_unistr2("", &(q_u->valuename),True,ps,depth); prs_align(ps); prs_uint32("size", ps, depth, &(q_u->size)); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_getprinterdata (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_r_getprinterdata"); depth++; @@ -472,15 +502,17 @@ void spoolss_io_r_getprinterdata(char *desc, SPOOL_R_GETPRINTERDATA *r_u, prs_st prs_uint32("needed", ps, depth, &(r_u->needed)); prs_uint32("status", ps, depth, &(r_u->status)); prs_align(ps); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_closeprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_closeprinter"); depth++; @@ -488,13 +520,15 @@ void spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct prs_align(ps); smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_closeprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_closeprinter"); depth++; @@ -503,15 +537,17 @@ void spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct smb_io_prt_hnd("printer handle",&(r_u->handle),ps,depth); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_startdocprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_startdocprinter"); depth++; @@ -521,27 +557,31 @@ void spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_ smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); smb_io_doc_info_container("",&(q_u->doc_info_container), ps, depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_startdocprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_startdocprinter(char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_startdocprinter(char *desc, SPOOL_R_STARTDOCPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_startdocprinter"); depth++; prs_uint32("jobid", ps, depth, &(r_u->jobid)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_enddocprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_enddocprinter"); depth++; @@ -549,26 +589,30 @@ void spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_stru prs_align(ps); smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_enddocprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_enddocprinter(char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enddocprinter(char *desc, SPOOL_R_ENDDOCPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_enddocprinter"); depth++; prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_startpageprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_startpageprinter"); depth++; @@ -576,26 +620,30 @@ void spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, pr prs_align(ps); smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_startpageprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_startpageprinter(char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_startpageprinter(char *desc, SPOOL_R_STARTPAGEPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_startpageprinter"); depth++; prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_endpageprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_endpageprinter"); depth++; @@ -603,26 +651,30 @@ void spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_st prs_align(ps); smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_endpageprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_endpageprinter(char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_endpageprinter(char *desc, SPOOL_R_ENDPAGEPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_endpageprinter"); depth++; prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_writeprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "spoolss_io_q_writeprinter"); depth++; @@ -639,25 +691,29 @@ void spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct } prs_align(ps); prs_uint32("buffer_size2", ps, depth, &(q_u->buffer_size2)); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_writeprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_writeprinter(char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_writeprinter(char *desc, SPOOL_R_WRITEPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_writeprinter"); depth++; prs_uint32("buffer_written", ps, depth, &(r_u->buffer_written)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_rffpcnex (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u, +BOOL spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u, prs_struct *ps, int depth) { uint32 useless_ptr; @@ -679,26 +735,30 @@ void spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u, smb_io_notify_option("notify option", &(q_u->option), ps, depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_rffpcnex (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_rffpcnex(char *desc, SPOOL_R_RFFPCNEX *r_u, +BOOL spoolss_io_r_rffpcnex(char *desc, SPOOL_R_RFFPCNEX *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_rffpcnex"); depth++; prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_q_rfnpcnex (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u, +BOOL spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_struct *ps, int depth) { @@ -712,13 +772,15 @@ void spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u, prs_uint32("change", ps, depth, &(q_u->change)); smb_io_notify_option("notify option",&(q_u->option),ps,depth); + + return True; } /******************************************************************* * write a structure. * called from spoolss_r_rfnpcnex (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_rfnpcnex(char *desc, +BOOL spoolss_io_r_rfnpcnex(char *desc, SPOOL_R_RFNPCNEX *r_u, prs_struct *ps, int depth) { @@ -732,6 +794,8 @@ void spoolss_io_r_rfnpcnex(char *desc, smb_io_notify_info("notify info",&(r_u->info),ps,depth); prs_align(ps); prs_uint32("status", ps, depth, &(x)); + + return True; } /******************************************************************* @@ -740,6 +804,8 @@ void spoolss_io_r_rfnpcnex(char *desc, static uint32 size_of_uint32(uint32 *value) { return (sizeof(*value)); + + return True; } /******************************************************************* @@ -756,6 +822,8 @@ static uint32 size_of_relative_string(UNISTR *string) size=size*2; /* convert in char */ size=size+4; /* add the size of the ptr */ return (size); + + return True; } /******************************************************************* @@ -767,6 +835,8 @@ static uint32 size_of_device_mode(DEVICEMODE *devmode) return (4); else return (0xDC+4); + + return True; } /******************************************************************* @@ -778,19 +848,23 @@ static uint32 size_of_systemtime(SYSTEMTIME *systime) return (4); else return (sizeof(SYSTEMTIME) +4); + + return True; } /******************************************************************* * write a UNICODE string. * used by all the RPC structs passing a buffer ********************************************************************/ -static void spoolss_smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth) +static BOOL spoolss_smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth) { - if (uni == NULL) return; + if (uni == NULL) return False; prs_debug(ps, depth, desc, "spoolss_smb_io_unistr"); depth++; prs_unistr("unistr", ps, depth, uni); + + return True; } @@ -798,7 +872,7 @@ static void spoolss_smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int * write a UNICODE string and its relative pointer. * used by all the RPC structs passing a buffer ********************************************************************/ -static void smb_io_relstr(char *desc, prs_struct *ps, int depth, UNISTR *buffer, +static BOOL smb_io_relstr(char *desc, prs_struct *ps, int depth, UNISTR *buffer, uint32 *start_offset, uint32 *end_offset) { uint32 struct_offset; @@ -813,6 +887,8 @@ static void smb_io_relstr(char *desc, prs_struct *ps, int depth, UNISTR *buffer, relative_offset=*end_offset-*start_offset; prs_uint32("offset", ps, depth, &(relative_offset)); + + return True; } @@ -820,7 +896,7 @@ static void smb_io_relstr(char *desc, prs_struct *ps, int depth, UNISTR *buffer, * write a array UNICODE strings and its relative pointer. * used by 2 RPC structs ********************************************************************/ -static void smb_io_relarraystr(char *desc, prs_struct *ps, int depth, UNISTR ***buffer, +static BOOL smb_io_relarraystr(char *desc, prs_struct *ps, int depth, UNISTR ***buffer, uint32 *start_offset, uint32 *end_offset) { int i=0; @@ -852,13 +928,15 @@ static void smb_io_relarraystr(char *desc, prs_struct *ps, int depth, UNISTR *** relative_offset=*end_offset-*start_offset; prs_uint32("offset", ps, depth, &(relative_offset)); + + return True; } /******************************************************************* * write a DEVICEMODE struct. * on reading allocate memory for the private member ********************************************************************/ -static void smb_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmode) +static BOOL smb_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmode) { prs_debug(ps, depth, desc, "smb_io_devmode"); depth++; @@ -910,13 +988,15 @@ static void smb_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *de prs_uint8s(True, "private", ps, depth, devmode->private, devmode->driverextra); DEBUG(8,("smb_io_devmode: parsed\n")); } + + return True; } /******************************************************************* * write a DEVMODE struct and its relative pointer. * used by all the RPC structs passing a buffer ********************************************************************/ -static void smb_io_reldevmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmode, +static BOOL smb_io_reldevmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmode, uint32 *start_offset, uint32 *end_offset) { uint32 struct_offset; @@ -935,11 +1015,13 @@ static void smb_io_reldevmode(char *desc, prs_struct *ps, int depth, DEVICEMODE relative_offset=*end_offset-*start_offset; prs_uint32("offset", ps, depth, &(relative_offset)); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_printer_info_0(char *desc, PRINTER_INFO_0 *info, prs_struct *ps, int depth, +static BOOL smb_io_printer_info_0(char *desc, PRINTER_INFO_0 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_printer_info_0"); @@ -977,11 +1059,13 @@ static void smb_io_printer_info_0(char *desc, PRINTER_INFO_0 *info, prs_struct * prs_uint32("unknown21", ps, depth, &(info->unknown21)); prs_uint16("unknown22", ps, depth, &(info->unknown22)); prs_uint32("unknown23", ps, depth, &(info->unknown23)); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_printer_info_1(char *desc, PRINTER_INFO_1 *info, prs_struct *ps, int depth, +static BOOL smb_io_printer_info_1(char *desc, PRINTER_INFO_1 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_printer_info_1"); @@ -992,11 +1076,13 @@ static void smb_io_printer_info_1(char *desc, PRINTER_INFO_1 *info, prs_struct * smb_io_relstr("description",ps, depth, &(info->description), start_offset, end_offset); smb_io_relstr("name",ps, depth, &(info->name), start_offset, end_offset); smb_io_relstr("comment",ps, depth, &(info->comment), start_offset, end_offset); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_printer_info_2(char *desc, PRINTER_INFO_2 *info, prs_struct *ps, int depth, +static BOOL smb_io_printer_info_2(char *desc, PRINTER_INFO_2 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { uint32 pipo=0; @@ -1042,11 +1128,13 @@ static void smb_io_printer_info_2(char *desc, PRINTER_INFO_2 *info, prs_struct * ps->offset=devmode_offset; smb_io_reldevmode("devmode", ps, depth, info->devmode, start_offset, end_offset); ps->offset=backup_offset; + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_printer_driver_info_1(char *desc, DRIVER_INFO_1 *info, prs_struct *ps, int depth, +static BOOL smb_io_printer_driver_info_1(char *desc, DRIVER_INFO_1 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_printer_driver_info_1"); @@ -1054,11 +1142,13 @@ static void smb_io_printer_driver_info_1(char *desc, DRIVER_INFO_1 *info, prs_st *start_offset=ps->offset; smb_io_relstr("name", ps, depth, &(info->name), start_offset, end_offset); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_printer_driver_info_2(char *desc, DRIVER_INFO_2 *info,prs_struct *ps, int depth, +static BOOL smb_io_printer_driver_info_2(char *desc, DRIVER_INFO_2 *info,prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_printer_xxx"); @@ -1071,11 +1161,13 @@ static void smb_io_printer_driver_info_2(char *desc, DRIVER_INFO_2 *info,prs_str smb_io_relstr("driverpath", ps, depth, &(info->driverpath), start_offset, end_offset); smb_io_relstr("datafile", ps, depth, &(info->datafile), start_offset, end_offset); smb_io_relstr("configfile", ps, depth, &(info->configfile), start_offset, end_offset); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_printer_driver_info_3(char *desc, DRIVER_INFO_3 *info,prs_struct *ps, int depth, +static BOOL smb_io_printer_driver_info_3(char *desc, DRIVER_INFO_3 *info,prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_printer_driver_info_3"); @@ -1094,11 +1186,13 @@ static void smb_io_printer_driver_info_3(char *desc, DRIVER_INFO_3 *info,prs_str smb_io_relstr("monitorname", ps, depth, &(info->monitorname), start_offset, end_offset); smb_io_relstr("defaultdatatype", ps, depth, &(info->defaultdatatype), start_offset, end_offset); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_job_info_1(char *desc, JOB_INFO_1 *info, prs_struct *ps, int depth, +static BOOL smb_io_job_info_1(char *desc, JOB_INFO_1 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_job_info_1"); @@ -1118,11 +1212,13 @@ static void smb_io_job_info_1(char *desc, JOB_INFO_1 *info, prs_struct *ps, int prs_uint32("totalpages", ps, depth, &(info->totalpages)); prs_uint32("pagesprinted", ps, depth, &(info->pagesprinted)); spoolss_io_system_time("submitted", ps, depth, &(info->submitted) ); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_job_info_2(char *desc, JOB_INFO_2 *info, prs_struct *ps, int depth, +static BOOL smb_io_job_info_2(char *desc, JOB_INFO_2 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { int pipo=0; @@ -1157,11 +1253,13 @@ static void smb_io_job_info_2(char *desc, JOB_INFO_2 *info, prs_struct *ps, int spoolss_io_system_time("submitted", ps, depth, &(info->submitted) ); prs_uint32("timeelapsed", ps, depth, &(info->timeelapsed)); prs_uint32("pagesprinted", ps, depth, &(info->pagesprinted)); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_form_1(char *desc, FORM_1 *info, prs_struct *ps, int depth, +static BOOL smb_io_form_1(char *desc, FORM_1 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_form_1"); @@ -1176,11 +1274,13 @@ static void smb_io_form_1(char *desc, FORM_1 *info, prs_struct *ps, int depth, prs_uint32("top", ps, depth, &(info->top)); prs_uint32("right", ps, depth, &(info->right)); prs_uint32("bottom", ps, depth, &(info->bottom)); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_port_2(char *desc, PORT_INFO_2 *info, prs_struct *ps, int depth, +static BOOL smb_io_port_2(char *desc, PORT_INFO_2 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_form_1"); @@ -1192,11 +1292,13 @@ static void smb_io_port_2(char *desc, PORT_INFO_2 *info, prs_struct *ps, int dep smb_io_relstr("description",ps, depth, &(info->description), start_offset, end_offset); prs_uint32("port_type", ps, depth, &(info->port_type)); prs_uint32("reserved", ps, depth, &(info->reserved)); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_processor_info_1(char *desc, PRINTPROCESSOR_1 *info, prs_struct *ps, int depth, +static BOOL smb_io_processor_info_1(char *desc, PRINTPROCESSOR_1 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_processor_info_1"); @@ -1204,11 +1306,13 @@ static void smb_io_processor_info_1(char *desc, PRINTPROCESSOR_1 *info, prs_stru *start_offset=ps->offset; smb_io_relstr("name",ps, depth, &(info->name), start_offset, end_offset); + + return True; } /******************************************************************* ********************************************************************/ -static void smb_io_monitor_info_1(char *desc, PRINTMONITOR_1 *info, prs_struct *ps, int depth, +static BOOL smb_io_monitor_info_1(char *desc, PRINTMONITOR_1 *info, prs_struct *ps, int depth, uint32 *start_offset, uint32 *end_offset) { prs_debug(ps, depth, desc, "smb_io_monitor_info_1"); @@ -1216,6 +1320,8 @@ static void smb_io_monitor_info_1(char *desc, PRINTMONITOR_1 *info, prs_struct * *start_offset=ps->offset; smb_io_relstr("name",ps, depth, &(info->name), start_offset, end_offset); + + return True; } /******************************************************************* @@ -1229,6 +1335,8 @@ static uint32 spoolss_size_printer_info_0(PRINTER_INFO_0 *info) size+=size_of_relative_string( &(info->printername) ); size+=size_of_relative_string( &(info->servername) ); return (size); + + return True; } /******************************************************************* @@ -1243,6 +1351,8 @@ static uint32 spoolss_size_printer_info_1(PRINTER_INFO_1 *info) size+=size_of_relative_string( &(info->name) ); size+=size_of_relative_string( &(info->comment) ); return (size); + + return True; } /******************************************************************* @@ -1278,6 +1388,8 @@ static uint32 spoolss_size_printer_info_2(PRINTER_INFO_2 *info) size+=size_of_uint32( &(info->cjobs) ); size+=size_of_uint32( &(info->averageppm) ); return (size); + + return True; } /******************************************************************* @@ -1291,6 +1403,8 @@ static uint32 spoolss_size_printer_driver_info_1(DRIVER_INFO_1 *info) DEBUGADD(9,("size: [%d]\n", size)); return (size); + + return True; } /******************************************************************* @@ -1309,6 +1423,8 @@ static uint32 spoolss_size_printer_driver_info_2(DRIVER_INFO_2 *info) DEBUGADD(9,("size: [%d]\n", size)); return (size); + + return True; } /******************************************************************* @@ -1342,6 +1458,8 @@ static uint32 spoolss_size_printer_driver_info_3(DRIVER_INFO_3 *info) DEBUGADD(9,("size: [%d]\n", size)); return (size); + + return True; } /******************************************************************* @@ -1364,6 +1482,8 @@ static uint32 spoolss_size_job_info_1(JOB_INFO_1 *info) size+=size_of_uint32( &(info->pagesprinted) ); size+=size_of_systemtime( &(info->submitted) ); return (size); + + return True; } /******************************************************************* @@ -1399,6 +1519,8 @@ static uint32 spoolss_size_job_info_2(JOB_INFO_2 *info) size+=size_of_uint32( &(info->timeelapsed) ); size+=size_of_uint32( &(info->pagesprinted) ); return (size); + + return True; } /******************************************************************* @@ -1418,6 +1540,8 @@ static uint32 spoolss_size_form_1(FORM_1 *info) size+=size_of_uint32( &(info->bottom) ); return (size); + + return True; } /******************************************************************* @@ -1435,6 +1559,8 @@ static uint32 spoolss_size_port_info_2(PORT_INFO_2 *info) size+=size_of_uint32( &(info->reserved) ); return (size); + + return True; } /******************************************************************* @@ -1446,6 +1572,8 @@ static uint32 spoolss_size_processor_info_1(PRINTPROCESSOR_1 *info) size+=size_of_relative_string( &(info->name) ); return (size); + + return True; } /******************************************************************* @@ -1457,6 +1585,8 @@ static uint32 spoolss_size_monitor_info_1(PRINTMONITOR_1 *info) size+=size_of_relative_string( &(info->name) ); return (size); + + return True; } /******************************************************************* @@ -1467,7 +1597,7 @@ static uint32 spoolss_size_monitor_info_1(PRINTMONITOR_1 *info) * * jfmxxxx: fix it to also write a buffer ********************************************************************/ -static void spoolss_io_read_buffer(char *desc, prs_struct *ps, int depth, BUFFER *buffer) +static BOOL spoolss_io_read_buffer(char *desc, prs_struct *ps, int depth, BUFFER *buffer) { prs_debug(ps, depth, desc, "spoolss_io_read_buffer"); depth++; @@ -1489,6 +1619,8 @@ static void spoolss_io_read_buffer(char *desc, prs_struct *ps, int depth, BUFFER buffer->data=0x0000; buffer->size=0x0000; } + + return True; } /******************************************************************* @@ -1499,7 +1631,7 @@ static void spoolss_io_read_buffer(char *desc, prs_struct *ps, int depth, BUFFER * * jfmxxxx: fix it to also write a buffer ********************************************************************/ -void spoolss_io_free_buffer(BUFFER *buffer) +BOOL spoolss_io_free_buffer(BUFFER *buffer) { DEBUG(8,("spoolss_io_free_buffer\n")); @@ -1507,13 +1639,15 @@ void spoolss_io_free_buffer(BUFFER *buffer) { free(buffer->data); } + + return True; } /******************************************************************* * read a structure. * called from spoolss_getprinterdriver2 (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_getprinterdriver2(char *desc, +BOOL spoolss_io_q_getprinterdriver2(char *desc, SPOOL_Q_GETPRINTERDRIVER2 *q_u, prs_struct *ps, int depth) { @@ -1537,13 +1671,15 @@ void spoolss_io_q_getprinterdriver2(char *desc, prs_uint32("buffer size", ps, depth, &(q_u->buf_size)); prs_uint32("status", ps, depth, &(q_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_getprinterdriver2 (srv_spoolss.c) ********************************************************************/ -void spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u, +BOOL spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; @@ -1658,13 +1794,15 @@ void spoolss_io_r_getprinterdriver2(char *desc, SPOOL_R_GETPRINTERDRIVER2 *r_u, prs_uint32("pipo", ps, depth, &pipo); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* * read a structure. * called from spoolss_enumprinters (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u, +BOOL spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *ps, int depth) { uint32 useless_ptr; @@ -1684,6 +1822,8 @@ void spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u, prs_uint32("level", ps, depth, &(q_u->level)); spoolss_io_read_buffer("buffer", ps, depth, &(q_u->buffer)); + + return True; } /******************************************************************* @@ -1691,7 +1831,7 @@ void spoolss_io_q_enumprinters(char *desc, SPOOL_Q_ENUMPRINTERS *q_u, * called from spoolss_r_enum_printers (srv_spoolss.c) * ********************************************************************/ -void spoolss_io_r_enumprinters(char *desc, +BOOL spoolss_io_r_enumprinters(char *desc, SPOOL_R_ENUMPRINTERS *r_u, prs_struct *ps, int depth) { @@ -1744,7 +1884,7 @@ void spoolss_io_r_enumprinters(char *desc, prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("count", ps, depth, &(r_u->returned)); prs_uint32("status", ps, depth, &(r_u->status)); - return; + return False; } mem_grow_data(&(ps->data), ps->io, r_u->offered, 0); @@ -1780,6 +1920,8 @@ void spoolss_io_r_enumprinters(char *desc, prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("count", ps, depth, &(r_u->returned)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* @@ -1787,7 +1929,7 @@ void spoolss_io_r_enumprinters(char *desc, * called from spoolss_r_enum_printers (srv_spoolss.c) * ********************************************************************/ -void spoolss_io_r_getprinter(char *desc, +BOOL spoolss_io_r_getprinter(char *desc, SPOOL_R_GETPRINTER *r_u, prs_struct *ps, int depth) { @@ -1905,6 +2047,8 @@ void spoolss_io_r_getprinter(char *desc, prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* @@ -1915,7 +2059,7 @@ void spoolss_io_r_getprinter(char *desc, * * jfmxxxx: fix it to also write a buffer ********************************************************************/ -static void spoolss_io_read_buffer8(char *desc, prs_struct *ps, uint8 **buffer, uint32 *size,int depth) +static BOOL spoolss_io_read_buffer8(char *desc, prs_struct *ps, uint8 **buffer, uint32 *size,int depth) { uint32 useless_ptr; @@ -1938,13 +2082,15 @@ static void spoolss_io_read_buffer8(char *desc, prs_struct *ps, uint8 **buffer, *buffer=0x0000; *size=0x0000; } + + return True; } /******************************************************************* * read a structure. * called from spoolss_getprinter (srv_spoolss.c) ********************************************************************/ -void spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u, +BOOL spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u, prs_struct *ps, int depth) { uint32 count; @@ -1965,11 +2111,13 @@ void spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u, } prs_uint32("buffer size", ps, depth, &(q_u->offered)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_setprinter"); depth++; @@ -1977,11 +2125,13 @@ void spoolss_io_r_setprinter(char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -static void spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE **devmode) +static BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE **devmode) { uint32 devmode_size=0x0; uint32 useless_ptr=0x0; @@ -2007,11 +2157,13 @@ static void spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE smb_io_devmode(desc, ps, depth, *devmode); } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_setprinter"); depth++; @@ -2034,11 +2186,13 @@ void spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps prs_uint32("security.data", ps, depth, &(q_u->security.data)); prs_uint32("command", ps, depth, &(q_u->command)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_fcpn"); depth++; @@ -2046,11 +2200,13 @@ void spoolss_io_r_fcpn(char *desc, SPOOL_R_FCPN *r_u, prs_struct *ps, int depth) prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_fcpn"); @@ -2059,12 +2215,14 @@ void spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth) prs_align(ps); smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); depth++; @@ -2072,11 +2230,13 @@ void spoolss_io_r_addjob(char *desc, SPOOL_R_ADDJOB *r_u, prs_struct *ps, int de prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); @@ -2092,11 +2252,13 @@ void spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int de prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -2207,11 +2369,13 @@ void spoolss_io_r_enumjobs(char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, in prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("numofjobs", ps, depth, &(r_u->numofjobs)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); @@ -2229,11 +2393,13 @@ void spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, in prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_schedulejob"); depth++; @@ -2241,11 +2407,13 @@ void spoolss_io_r_schedulejob(char *desc, SPOOL_R_SCHEDULEJOB *r_u, prs_struct * prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_schedulejob"); depth++; @@ -2254,11 +2422,13 @@ void spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct * smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth); prs_uint32("jobid", ps, depth, &(q_u->jobid)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_setjob"); depth++; @@ -2266,11 +2436,13 @@ void spoolss_io_r_setjob(char *desc, SPOOL_R_SETJOB *r_u, prs_struct *ps, int de prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_setjob"); depth++; @@ -2285,11 +2457,13 @@ void spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int de */ prs_uint32("level", ps, depth, &(q_u->level)); prs_uint32("command", ps, depth, &(q_u->command)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -2411,11 +2585,13 @@ void spoolss_io_r_enumdrivers(char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_s prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("numofdrivers", ps, depth, &(r_u->numofdrivers)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumprinterdrivers(char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumprinterdrivers(char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; @@ -2433,11 +2609,13 @@ void spoolss_io_q_enumprinterdrivers(char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u spoolss_io_read_buffer("", ps, depth, &(q_u->buffer)); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -2520,11 +2698,13 @@ void spoolss_io_r_enumforms(char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("numofforms", ps, depth, &(r_u->numofforms)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); @@ -2536,11 +2716,13 @@ void spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps, spoolss_io_read_buffer("", ps, depth, &(q_u->buffer)); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -2618,11 +2800,13 @@ void spoolss_io_r_enumports(char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("numofports", ps, depth, &(r_u->numofports)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth) { uint32 useless; prs_debug(ps, depth, desc, ""); @@ -2636,12 +2820,14 @@ void spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, spoolss_io_read_buffer("", ps, depth, &(q_u->buffer)); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 **q_u, prs_struct *ps, int depth) +BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 **q_u, prs_struct *ps, int depth) { SPOOL_PRINTER_INFO_LEVEL_2 *il; @@ -2709,11 +2895,13 @@ void spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 **q_u, } */ + + return True; } /******************************************************************* ********************************************************************/ -void spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_struct *ps, int depth) +BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_struct *ps, int depth) { uint32 useless; uint32 level; @@ -2741,11 +2929,13 @@ void spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_s break; } + + return True; } /******************************************************************* ********************************************************************/ -void spool_io_user_level_1(char *desc, SPOOL_USER_LEVEL_1 **q_u, prs_struct *ps, int depth) +BOOL spool_io_user_level_1(char *desc, SPOOL_USER_LEVEL_1 **q_u, prs_struct *ps, int depth) { SPOOL_USER_LEVEL_1 *il; prs_debug(ps, depth, desc, ""); @@ -2775,11 +2965,13 @@ void spool_io_user_level_1(char *desc, SPOOL_USER_LEVEL_1 **q_u, prs_struct *ps, smb_io_unistr2("", &(il->client_name), il->client_name_ptr, ps, depth); prs_align(ps); smb_io_unistr2("", &(il->user_name), il->user_name_ptr, ps, depth); + + return True; } /******************************************************************* ********************************************************************/ -void spool_io_user_level(char *desc, SPOOL_USER_LEVEL *q_u, prs_struct *ps, int depth) +BOOL spool_io_user_level(char *desc, SPOOL_USER_LEVEL *q_u, prs_struct *ps, int depth) { uint32 useless; uint32 level; @@ -2797,11 +2989,13 @@ void spool_io_user_level(char *desc, SPOOL_USER_LEVEL *q_u, prs_struct *ps, int break; } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth) { uint32 useless; prs_debug(ps, depth, desc, "spoolss_io_q_addprinterex"); @@ -2839,12 +3033,14 @@ void spoolss_io_q_addprinterex(char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct prs_uint32("info_level", ps, depth, &(q_u->user_level)); spool_io_user_level("", &(q_u->user), ps, depth); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_addprinterex"); depth++; @@ -2852,11 +3048,13 @@ void spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u, prs_struct smb_io_prt_hnd("printer handle",&(r_u->handle),ps,depth); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **q_u, +BOOL spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 **q_u, prs_struct *ps, int depth) { SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *il; @@ -2906,6 +3104,8 @@ void spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_ if (il->dependentfiles_ptr) smb_io_buffer5("", &(il->dependentfiles), ps, depth); + + return True; } @@ -2918,7 +3118,7 @@ void spool_io_printer_driver_info_level_3(char *desc, SPOOL_PRINTER_DRIVER_INFO_ dynamically allocate memory ********************************************************************/ -void uniarray_2_ascarray(BUFFER5 *buf5, char ***ar) +BOOL uniarray_2_ascarray(BUFFER5 *buf5, char ***ar) { char **array; char *string; @@ -2929,7 +3129,7 @@ void uniarray_2_ascarray(BUFFER5 *buf5, char ***ar) uint16 *src; - if (buf5==NULL) return; + if (buf5==NULL) return False; array=NULL; n=0; @@ -2962,6 +3162,8 @@ void uniarray_2_ascarray(BUFFER5 *buf5, char ***ar) *ar=array; DEBUG(10,("Number of dependent files: [%d]\n", i-1)); + + return True; } /******************************************************************* @@ -2969,10 +3171,9 @@ void uniarray_2_ascarray(BUFFER5 *buf5, char ***ar) and null terminated array and size of array at beginning ********************************************************************/ -void smb_io_unibuffer(char *desc, UNISTR2 *buffer, prs_struct *ps, int depth) +BOOL smb_io_unibuffer(char *desc, UNISTR2 *buffer, prs_struct *ps, int depth) { - - if (buffer==NULL) return; + if (buffer==NULL) return False; buffer->undoc=0; buffer->uni_str_len=buffer->uni_max_len; @@ -2981,11 +3182,13 @@ void smb_io_unibuffer(char *desc, UNISTR2 *buffer, prs_struct *ps, int depth) prs_unistr2(True, "buffer ", ps, depth, buffer); + + return True; } /******************************************************************* ********************************************************************/ -void spool_io_printer_driver_info_level(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL *il, prs_struct *ps, int depth) +BOOL spool_io_printer_driver_info_level(char *desc, SPOOL_PRINTER_DRIVER_INFO_LEVEL *il, prs_struct *ps, int depth) { uint32 useless; uint32 level; @@ -3003,11 +3206,13 @@ void spool_io_printer_driver_info_level(char *desc, SPOOL_PRINTER_DRIVER_INFO_LE break; } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_addprinterdriver(char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_addprinterdriver(char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth) { uint32 useless; prs_debug(ps, depth, desc, ""); @@ -3020,22 +3225,26 @@ void spoolss_io_q_addprinterdriver(char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, pr prs_uint32("info_level", ps, depth, &(q_u->level)); spool_io_printer_driver_info_level("", &(q_u->info), ps, depth); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_addprinterdriver(char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_addprinterdriver(char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); depth++; prs_uint32("status", ps, depth, &(q_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni, +BOOL uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni, NT_PRINTER_DRIVER_INFO_LEVEL_3 **asc) { NT_PRINTER_DRIVER_INFO_LEVEL_3 *d; @@ -3072,9 +3281,11 @@ void uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni, DEBUGADD(8,( "defaultdatatype: %s\n", d->defaultdatatype)); uniarray_2_ascarray(&(uni->dependentfiles), &(d->dependentfiles) ); + + return True; } -void uni_2_asc_printer_info_2(SPOOL_PRINTER_INFO_LEVEL_2 *uni, +BOOL uni_2_asc_printer_info_2(SPOOL_PRINTER_INFO_LEVEL_2 *uni, NT_PRINTER_INFO_LEVEL_2 **asc) { NT_PRINTER_INFO_LEVEL_2 *d; @@ -3111,9 +3322,11 @@ void uni_2_asc_printer_info_2(SPOOL_PRINTER_INFO_LEVEL_2 *uni, unistr2_to_ascii(d->printprocessor, &(uni->printprocessor), sizeof(d->printprocessor)-1); unistr2_to_ascii(d->datatype, &(uni->datatype), sizeof(d->datatype)-1); unistr2_to_ascii(d->parameters, &(uni->parameters), sizeof(d->parameters)-1); + + return True; } -void convert_printer_info(SPOOL_PRINTER_INFO_LEVEL uni, +BOOL convert_printer_info(SPOOL_PRINTER_INFO_LEVEL uni, NT_PRINTER_INFO_LEVEL *printer, uint32 level) { @@ -3129,9 +3342,11 @@ void convert_printer_info(SPOOL_PRINTER_INFO_LEVEL uni, } + + return True; } -void convert_printer_driver_info(SPOOL_PRINTER_DRIVER_INFO_LEVEL uni, +BOOL convert_printer_driver_info(SPOOL_PRINTER_DRIVER_INFO_LEVEL uni, NT_PRINTER_DRIVER_INFO_LEVEL *printer, uint32 level) { @@ -3148,9 +3363,11 @@ void convert_printer_driver_info(SPOOL_PRINTER_DRIVER_INFO_LEVEL uni, } + + return True; } -void convert_devicemode(DEVICEMODE devmode, NT_DEVICEMODE *nt_devmode) +BOOL convert_devicemode(DEVICEMODE devmode, NT_DEVICEMODE *nt_devmode) { unistr_to_ascii(nt_devmode->devicename, devmode.devicename.buffer, @@ -3203,11 +3420,13 @@ void convert_devicemode(DEVICEMODE devmode, NT_DEVICEMODE *nt_devmode) memcpy(nt_devmode->private, devmode.private, nt_devmode->driverextra); } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -3280,11 +3499,13 @@ void spoolss_io_r_getprinterdriverdir(char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_getprinterdriverdir(char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_getprinterdriverdir(char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; @@ -3302,11 +3523,13 @@ void spoolss_io_q_getprinterdriverdir(char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q spoolss_io_read_buffer("", ps, depth, &(q_u->buffer)); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -3384,11 +3607,13 @@ void spoolss_io_r_enumprintprocessors(char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("numofprintprocessors", ps, depth, &(r_u->numofprintprocessors)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth) { uint32 useless; prs_debug(ps, depth, desc, "spoolss_io_q_enumprintprocessors"); @@ -3405,11 +3630,13 @@ void spoolss_io_q_enumprintprocessors(char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q spoolss_io_read_buffer("", ps, depth, &(q_u->buffer)); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -3487,11 +3714,13 @@ void spoolss_io_r_enumprintmonitors(char *desc, SPOOL_R_ENUMPRINTMONITORS *r_u, prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("numofprintmonitors", ps, depth, &(r_u->numofprintmonitors)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumprintmonitors(char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumprintmonitors(char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, prs_struct *ps, int depth) { uint32 useless; prs_debug(ps, depth, desc, "spoolss_io_q_enumprintmonitors"); @@ -3505,11 +3734,13 @@ void spoolss_io_q_enumprintmonitors(char *desc, SPOOL_Q_ENUMPRINTMONITORS *q_u, spoolss_io_read_buffer("", ps, depth, &(q_u->buffer)); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_enumprinterdata"); depth++; @@ -3525,11 +3756,13 @@ void spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_ prs_uint8s(False, "data", ps, depth, r_u->data, r_u->datasize); prs_uint32("realdatasize", ps, depth, &(r_u->realdatasize)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_enumprinterdata"); depth++; @@ -3539,11 +3772,13 @@ void spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_ prs_uint32("index", ps, depth, &(q_u->index)); prs_uint32("valuesize", ps, depth, &(q_u->valuesize)); prs_uint32("datasize", ps, depth, &(q_u->datasize)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_q_setprinterdata"); depth++; @@ -3571,22 +3806,26 @@ void spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_st } prs_uint32("real_len", ps, depth, &(q_u->real_len)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_setprinterdata(char *desc, SPOOL_R_SETPRINTERDATA *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_setprinterdata"); depth++; prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void convert_specific_param(NT_PRINTER_PARAM **param, UNISTR2 value , uint32 type, uint8 *data, uint32 len) +BOOL convert_specific_param(NT_PRINTER_PARAM **param, UNISTR2 value , uint32 type, uint8 *data, uint32 len) { DEBUG(5,("converting a specific param struct\n")); @@ -3609,11 +3848,13 @@ void convert_specific_param(NT_PRINTER_PARAM **param, UNISTR2 value , uint32 typ memcpy((*param)->data, data, len); DEBUGADD(6,("\tvalue:[%s], len:[%d]\n",(*param)->value, (*param)->data_len)); + + return True; } /******************************************************************* ********************************************************************/ -static void spoolss_io_addform(char *desc, FORM *f, uint32 ptr, prs_struct *ps, int depth) +static BOOL spoolss_io_addform(char *desc, FORM *f, uint32 ptr, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_addform"); depth++; @@ -3632,11 +3873,13 @@ static void spoolss_io_addform(char *desc, FORM *f, uint32 ptr, prs_struct *ps, smb_io_unistr2("", &(f->name), f->name_ptr, ps, depth); } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int depth) { uint32 useless_ptr=0; prs_debug(ps, depth, desc, "spoolss_io_q_addform"); @@ -3652,22 +3895,26 @@ void spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int prs_uint32("useless_ptr", ps, depth, &(useless_ptr)); spoolss_io_addform("", &(q_u->form), useless_ptr, ps, depth); } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_addform(char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_addform(char *desc, SPOOL_R_ADDFORM *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_addform"); depth++; prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int depth) { uint32 useless_ptr=0; prs_debug(ps, depth, desc, "spoolss_io_q_setform"); @@ -3687,22 +3934,26 @@ void spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int prs_uint32("useless_ptr", ps, depth, &(useless_ptr)); spoolss_io_addform("", &(q_u->form), useless_ptr, ps, depth); } + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_setform(char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_setform(char *desc, SPOOL_R_SETFORM *r_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, "spoolss_io_r_setform"); depth++; prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int depth) +BOOL spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int depth) { uint32 useless_ptr=0xADDE0FF0; uint32 start_offset, end_offset, beginning; @@ -3789,11 +4040,13 @@ void spoolss_io_r_getjob(char *desc, SPOOL_R_GETJOB *r_u, prs_struct *ps, int de prs_uint32("size of buffer needed", ps, depth, &(bufsize_required)); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* ********************************************************************/ -void spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int depth) +BOOL spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int depth) { prs_debug(ps, depth, desc, ""); @@ -3810,4 +4063,6 @@ void spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int de prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } diff --git a/source3/rpc_parse/parse_srv.c b/source3/rpc_parse/parse_srv.c index f04e5eabbc..9e140bcc3e 100644 --- a/source3/rpc_parse/parse_srv.c +++ b/source3/rpc_parse/parse_srv.c @@ -3,9 +3,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,22 +31,24 @@ extern int DEBUGLEVEL; /******************************************************************* makes a SH_INFO_1_STR structure ********************************************************************/ -void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark) +BOOL make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark) { - if (sh1 == NULL) return; + if (sh1 == NULL) return False; DEBUG(5,("make_srv_share_info1_str\n")); make_unistr2(&(sh1->uni_netname), net_name, strlen(net_name)+1); make_unistr2(&(sh1->uni_remark ), remark , strlen(remark )+1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth) +static BOOL srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth) { - if (sh1 == NULL) return; + if (sh1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_share_info1_str"); depth++; @@ -55,28 +57,32 @@ static void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct * smb_io_unistr2("", &(sh1->uni_netname), True, ps, depth); smb_io_unistr2("", &(sh1->uni_remark ), True, ps, depth); + + return True; } /******************************************************************* makes a SH_INFO_1 structure ********************************************************************/ -void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark) +BOOL make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark) { - if (sh1 == NULL) return; + if (sh1 == NULL) return False; DEBUG(5,("make_srv_share_info1: %s %8x %s\n", net_name, type, remark)); sh1->ptr_netname = net_name != NULL ? 1 : 0; sh1->type = type; sh1->ptr_remark = remark != NULL ? 1 : 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth) +static BOOL srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth) { - if (sh1 == NULL) return; + if (sh1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_share_info1"); depth++; @@ -86,14 +92,16 @@ static void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int prs_uint32("ptr_netname", ps, depth, &(sh1->ptr_netname)); prs_uint32("type ", ps, depth, &(sh1->type )); prs_uint32("ptr_remark ", ps, depth, &(sh1->ptr_remark)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth) +static BOOL srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_share_1_ctr"); depth++; @@ -130,16 +138,18 @@ static void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_stru prs_align(ps); } + + return True; } /******************************************************************* makes a SH_INFO_2_STR structure ********************************************************************/ -void make_srv_share_info2_str(SH_INFO_2_STR *sh2, +BOOL make_srv_share_info2_str(SH_INFO_2_STR *sh2, char *net_name, char *remark, char *path, char *passwd) { - if (sh2 == NULL) return; + if (sh2 == NULL) return False; DEBUG(5,("make_srv_share_info2_str\n")); @@ -147,14 +157,16 @@ void make_srv_share_info2_str(SH_INFO_2_STR *sh2, make_unistr2(&(sh2->uni_remark ), remark , strlen(remark )+1); make_unistr2(&(sh2->uni_path ), path , strlen(path )+1); make_unistr2(&(sh2->uni_passwd ), passwd , strlen(passwd )+1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth) +static BOOL srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth) { - if (sh2 == NULL) return; + if (sh2 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_share_info2_str"); depth++; @@ -165,17 +177,19 @@ static void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct * smb_io_unistr2("", &(sh2->uni_remark ), True, ps, depth); smb_io_unistr2("", &(sh2->uni_path ), True, ps, depth); smb_io_unistr2("", &(sh2->uni_passwd ), True, ps, depth); + + return True; } /******************************************************************* makes a SH_INFO_2 structure ********************************************************************/ -void make_srv_share_info2(SH_INFO_2 *sh2, +BOOL make_srv_share_info2(SH_INFO_2 *sh2, char *net_name, uint32 type, char *remark, uint32 perms, uint32 max_uses, uint32 num_uses, char *path, char *passwd) { - if (sh2 == NULL) return; + if (sh2 == NULL) return False; DEBUG(5,("make_srv_share_info2: %s %8x %s\n", net_name, type, remark)); @@ -188,14 +202,16 @@ void make_srv_share_info2(SH_INFO_2 *sh2, sh2->type = type; sh2->ptr_path = path != NULL ? 1 : 0; sh2->ptr_passwd = passwd != NULL ? 1 : 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth) +static BOOL srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth) { - if (sh2 == NULL) return; + if (sh2 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_share_info2"); depth++; @@ -210,14 +226,16 @@ static void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int prs_uint32("num_uses ", ps, depth, &(sh2->num_uses )); prs_uint32("ptr_path ", ps, depth, &(sh2->ptr_path )); prs_uint32("ptr_passwd ", ps, depth, &(sh2->ptr_passwd )); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth) +static BOOL srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_share_2_ctr"); depth++; @@ -254,14 +272,16 @@ static void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_stru prs_align(ps); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth) +static BOOL srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_share_ctr"); depth++; @@ -293,18 +313,20 @@ static void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struc } } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, +BOOL make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, char *srv_name, uint32 share_level, SRV_SHARE_INFO_CTR *ctr, uint32 preferred_len, ENUM_HND *hnd) { - if (q_n == NULL || ctr == NULL || hnd == NULL) return; + if (q_n == NULL || ctr == NULL || hnd == NULL) return False; q_n->ctr = ctr; @@ -316,14 +338,16 @@ void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, q_n->preferred_len = preferred_len; memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth) +BOOL srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth) { - if (q_n == NULL) return; + if (q_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_q_net_share_enum"); depth++; @@ -345,14 +369,16 @@ void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct prs_uint32("preferred_len", ps, depth, &(q_n->preferred_len)); smb_io_enum_hnd("enum_hnd", &(q_n->enum_hnd), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth) +BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth) { - if (r_n == NULL) return; + if (r_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_r_net_share_enum"); depth++; @@ -369,26 +395,30 @@ void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct prs_uint32("total_entries", ps, depth, &(r_n->total_entries)); smb_io_enum_hnd("enum_hnd", &(r_n->enum_hnd), ps, depth); prs_uint32("status ", ps, depth, &(r_n->status)); + + return True; } /******************************************************************* makes a SESS_INFO_0_STR structure ********************************************************************/ -void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name) +BOOL make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; DEBUG(5,("make_srv_sess_info0_str\n")); make_unistr2(&(ss0->uni_name), name, strlen(name)+1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth) +static BOOL srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_sess_info0_str"); depth++; @@ -396,26 +426,30 @@ static void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct prs_align(ps); smb_io_unistr2("", &(ss0->uni_name), True, ps, depth); + + return True; } /******************************************************************* makes a SESS_INFO_0 structure ********************************************************************/ -void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name) +BOOL make_srv_sess_info0(SESS_INFO_0 *ss0, char *name) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; DEBUG(5,("make_srv_sess_info0: %s\n", name)); ss0->ptr_name = name != NULL ? 1 : 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth) +static BOOL srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_sess_info0"); depth++; @@ -423,14 +457,16 @@ static void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int prs_align(ps); prs_uint32("ptr_name", ps, depth, &(ss0->ptr_name)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth) +static BOOL srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_sess_info_0"); depth++; @@ -467,27 +503,31 @@ static void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct prs_align(ps); } + + return True; } /******************************************************************* makes a SESS_INFO_1_STR structure ********************************************************************/ -void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user) +BOOL make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; DEBUG(5,("make_srv_sess_info1_str\n")); make_unistr2(&(ss1->uni_name), name, strlen(name)+1); make_unistr2(&(ss1->uni_user), name, strlen(user)+1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth) +static BOOL srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_sess_info1_str"); depth++; @@ -496,17 +536,19 @@ static void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct smb_io_unistr2("", &(ss1->uni_name), True, ps, depth); smb_io_unistr2("", &(ss1->uni_user), True, ps, depth); + + return True; } /******************************************************************* makes a SESS_INFO_1 structure ********************************************************************/ -void make_srv_sess_info1(SESS_INFO_1 *ss1, +BOOL make_srv_sess_info1(SESS_INFO_1 *ss1, char *name, char *user, uint32 num_opens, uint32 open_time, uint32 idle_time, uint32 user_flags) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; DEBUG(5,("make_srv_sess_info1: %s\n", name)); @@ -517,14 +559,16 @@ void make_srv_sess_info1(SESS_INFO_1 *ss1, ss1->open_time = open_time; ss1->idle_time = idle_time; ss1->user_flags = user_flags; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth) +static BOOL srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_sess_info1"); depth++; @@ -538,14 +582,16 @@ static void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int prs_uint32("open_time ", ps, depth, &(ss1->open_time )); prs_uint32("idle_time ", ps, depth, &(ss1->idle_time )); prs_uint32("user_flags", ps, depth, &(ss1->user_flags)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth) +static BOOL srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_sess_info_1"); depth++; @@ -582,14 +628,16 @@ static void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct prs_align(ps); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void 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 *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_sess_ctr"); depth++; @@ -621,19 +669,21 @@ static void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct } } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, +BOOL make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, char *srv_name, char *qual_name, char *user_name, uint32 sess_level, SRV_SESS_INFO_CTR *ctr, uint32 preferred_len, ENUM_HND *hnd) { - if (q_n == NULL || ctr == NULL || hnd == NULL) return; + if (q_n == NULL || ctr == NULL || hnd == NULL) return False; q_n->ctr = ctr; @@ -647,14 +697,16 @@ void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, q_n->preferred_len = preferred_len; memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth) +BOOL srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth) { - if (q_n == NULL) return; + if (q_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_q_net_sess_enum"); depth++; @@ -684,14 +736,16 @@ void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *p prs_uint32("preferred_len", ps, depth, &(q_n->preferred_len)); smb_io_enum_hnd("enum_hnd", &(q_n->enum_hnd), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth) +BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth) { - if (r_n == NULL) return; + if (r_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_r_net_sess_enum"); depth++; @@ -708,26 +762,30 @@ void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *p prs_uint32("total_entries", ps, depth, &(r_n->total_entries)); smb_io_enum_hnd("enum_hnd", &(r_n->enum_hnd), ps, depth); prs_uint32("status ", ps, depth, &(r_n->status)); + + return True; } /******************************************************************* makes a CONN_INFO_0 structure ********************************************************************/ -void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id) +BOOL make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; DEBUG(5,("make_srv_conn_info0\n")); ss0->id = id; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth) +static BOOL srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_conn_info0"); depth++; @@ -735,14 +793,16 @@ static void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int prs_align(ps); prs_uint32("id", ps, depth, &(ss0->id)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth) +static BOOL srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth) { - if (ss0 == NULL) return; + if (ss0 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_conn_info_0"); depth++; @@ -771,27 +831,31 @@ static void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct prs_align(ps); } + + return True; } /******************************************************************* makes a CONN_INFO_1_STR structure ********************************************************************/ -void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name) +BOOL make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; DEBUG(5,("make_srv_conn_info1_str\n")); make_unistr2(&(ss1->uni_usr_name), usr_name, strlen(usr_name)+1); make_unistr2(&(ss1->uni_net_name), net_name, strlen(net_name)+1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth) +static BOOL srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_conn_info1_str"); depth++; @@ -800,17 +864,19 @@ static void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct smb_io_unistr2("", &(ss1->uni_usr_name), True, ps, depth); smb_io_unistr2("", &(ss1->uni_net_name), True, ps, depth); + + return True; } /******************************************************************* makes a CONN_INFO_1 structure ********************************************************************/ -void make_srv_conn_info1(CONN_INFO_1 *ss1, +BOOL make_srv_conn_info1(CONN_INFO_1 *ss1, uint32 id, uint32 type, uint32 num_opens, uint32 num_users, uint32 open_time, char *usr_name, char *net_name) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; DEBUG(5,("make_srv_conn_info1: %s %s\n", usr_name, net_name)); @@ -822,14 +888,16 @@ void make_srv_conn_info1(CONN_INFO_1 *ss1, ss1->ptr_usr_name = usr_name != NULL ? 1 : 0; ss1->ptr_net_name = net_name != NULL ? 1 : 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth) +static BOOL srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_conn_info1"); depth++; @@ -844,14 +912,16 @@ static void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int prs_uint32("ptr_usr_name", ps, depth, &(ss1->ptr_usr_name)); prs_uint32("ptr_net_name", ps, depth, &(ss1->ptr_net_name)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth) +static BOOL srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth) { - if (ss1 == NULL) return; + if (ss1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_conn_info_1"); depth++; @@ -886,14 +956,16 @@ static void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct prs_align(ps); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void 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 *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_conn_ctr"); depth++; @@ -925,18 +997,20 @@ static void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct } } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, +BOOL make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, char *srv_name, char *qual_name, uint32 conn_level, SRV_CONN_INFO_CTR *ctr, uint32 preferred_len, ENUM_HND *hnd) { - if (q_n == NULL || ctr == NULL || hnd == NULL) return; + if (q_n == NULL || ctr == NULL || hnd == NULL) return False; q_n->ctr = ctr; @@ -949,14 +1023,16 @@ void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, q_n->preferred_len = preferred_len; memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth) +BOOL srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth) { - if (q_n == NULL) return; + if (q_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_q_net_conn_enum"); depth++; @@ -983,14 +1059,16 @@ void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *p prs_uint32("preferred_len", ps, depth, &(q_n->preferred_len)); smb_io_enum_hnd("enum_hnd", &(q_n->enum_hnd), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth) +BOOL srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth) { - if (r_n == NULL) return; + if (r_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_r_net_conn_enum"); depth++; @@ -1007,27 +1085,31 @@ void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *p prs_uint32("total_entries", ps, depth, &(r_n->total_entries)); smb_io_enum_hnd("enum_hnd", &(r_n->enum_hnd), ps, depth); prs_uint32("status ", ps, depth, &(r_n->status)); + + return True; } /******************************************************************* makes a FILE_INFO_3_STR structure ********************************************************************/ -void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name) +BOOL make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name) { - if (fi3 == NULL) return; + if (fi3 == NULL) return False; DEBUG(5,("make_srv_file_info3_str\n")); make_unistr2(&(fi3->uni_path_name), path_name, strlen(path_name)+1); make_unistr2(&(fi3->uni_user_name), user_name, strlen(user_name)+1); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth) +static BOOL srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth) { - if (sh1 == NULL) return; + if (sh1 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_file_info3_str"); depth++; @@ -1036,16 +1118,18 @@ static void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct smb_io_unistr2("", &(sh1->uni_path_name), True, ps, depth); smb_io_unistr2("", &(sh1->uni_user_name), True, ps, depth); + + return True; } /******************************************************************* makes a FILE_INFO_3 structure ********************************************************************/ -void make_srv_file_info3(FILE_INFO_3 *fl3, +BOOL make_srv_file_info3(FILE_INFO_3 *fl3, uint32 id, uint32 perms, uint32 num_locks, char *path_name, char *user_name) { - if (fl3 == NULL) return; + if (fl3 == NULL) return False; DEBUG(5,("make_srv_file_info3: %s %s\n", path_name, user_name)); @@ -1055,14 +1139,16 @@ void make_srv_file_info3(FILE_INFO_3 *fl3, fl3->ptr_path_name = path_name != NULL ? 1 : 0; fl3->ptr_user_name = user_name != NULL ? 1 : 0; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth) +static BOOL srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth) { - if (fl3 == NULL) return; + if (fl3 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_file_info3"); depth++; @@ -1074,14 +1160,16 @@ static void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int prs_uint32("num_locks ", ps, depth, &(fl3->num_locks )); prs_uint32("ptr_path_name", ps, depth, &(fl3->ptr_path_name)); prs_uint32("ptr_user_name", ps, depth, &(fl3->ptr_user_name)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth) +static BOOL srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth) { - if (fl3 == NULL) return; + if (fl3 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_file_3_fl3"); depth++; @@ -1115,14 +1203,16 @@ static void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct prs_align(ps); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -static void 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 *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_srv_file_ctr"); depth++; @@ -1149,18 +1239,20 @@ static void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct } } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, +BOOL make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, char *srv_name, char *qual_name, uint32 file_id, uint32 file_level, SRV_FILE_INFO_CTR *ctr, uint32 preferred_len, ENUM_HND *hnd) { - if (q_n == NULL || ctr == NULL || hnd == NULL) return; + if (q_n == NULL || ctr == NULL || hnd == NULL) return False; q_n->ctr = ctr; @@ -1174,14 +1266,16 @@ void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, q_n->preferred_len = preferred_len; memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth) +BOOL srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth) { - if (q_n == NULL) return; + if (q_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_q_net_file_enum"); depth++; @@ -1209,14 +1303,16 @@ void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *p prs_uint32("preferred_len", ps, depth, &(q_n->preferred_len)); smb_io_enum_hnd("enum_hnd", &(q_n->enum_hnd), ps, depth); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth) +BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth) { - if (r_n == NULL) return; + if (r_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_r_net_file_enum"); depth++; @@ -1233,16 +1329,18 @@ void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *p prs_uint32("total_entries", ps, depth, &(r_n->total_entries)); smb_io_enum_hnd("enum_hnd", &(r_n->enum_hnd), ps, depth); prs_uint32("status ", ps, depth, &(r_n->status)); + + return True; } /******************************************************************* makes a SRV_INFO_101 structure. ********************************************************************/ -void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, +BOOL make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, uint32 ver_major, uint32 ver_minor, uint32 srv_type, char *comment) { - if (sv101 == NULL) return; + if (sv101 == NULL) return False; DEBUG(5,("make_srv_info_101\n")); @@ -1252,15 +1350,17 @@ void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, sv101->ver_minor = ver_minor; sv101->srv_type = srv_type; make_buf_unistr2(&(sv101->uni_comment ), &(sv101->ptr_comment) , comment ); + + return True; } /******************************************************************* reads or writes a SRV_INFO_101 structure. ********************************************************************/ -static void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth) +static BOOL srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth) { - if (sv101 == NULL) return; + if (sv101 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_info_101"); depth++; @@ -1278,18 +1378,20 @@ static void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, in smb_io_unistr2("uni_name ", &(sv101->uni_name ), True, ps, depth); smb_io_unistr2("uni_comment ", &(sv101->uni_comment ), True, ps, depth); + + return True; } /******************************************************************* makes a SRV_INFO_102 structure. ********************************************************************/ -void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, +BOOL make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, char *comment, uint32 ver_major, uint32 ver_minor, uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, uint32 announce, uint32 ann_delta, uint32 licenses, char *usr_path) { - if (sv102 == NULL) return; + if (sv102 == NULL) return False; DEBUG(5,("make_srv_info_102\n")); @@ -1309,15 +1411,17 @@ void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, sv102->ann_delta =ann_delta; sv102->licenses = licenses; make_buf_unistr2(&(sv102->uni_usr_path), &(sv102->ptr_usr_path), usr_path); + + return True; } /******************************************************************* reads or writes a SRV_INFO_102 structure. ********************************************************************/ -static void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth) +static BOOL srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth) { - if (sv102 == NULL) return; + if (sv102 == NULL) return False; prs_debug(ps, depth, desc, "srv_io_info102"); depth++; @@ -1346,14 +1450,16 @@ static void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, in smb_io_unistr2("uni_comment ", &(sv102->uni_comment ), True, ps, depth); prs_align(ps); smb_io_unistr2("uni_usr_path", &(sv102->uni_usr_path), True, ps, depth); + + return True; } /******************************************************************* reads or writes a SRV_INFO_102 structure. ********************************************************************/ -static void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth) +static BOOL srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth) { - if (ctr == NULL) return; + if (ctr == NULL) return False; prs_debug(ps, depth, desc, "srv_io_info_ctr"); depth++; @@ -1386,29 +1492,33 @@ static void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int } prs_align(ps); } + + return True; } /******************************************************************* makes a SRV_Q_NET_SRV_GET_INFO structure. ********************************************************************/ -void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, +BOOL make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, char *server_name, uint32 switch_value) { - if (srv == NULL) return; + if (srv == NULL) return False; DEBUG(5,("make_srv_q_net_srv_get_info\n")); make_buf_unistr2(&(srv->uni_srv_name), &(srv->ptr_srv_name), server_name); srv->switch_value = switch_value; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth) +BOOL srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth) { - if (q_n == NULL) return; + if (q_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_q_net_srv_get_info"); depth++; @@ -1421,15 +1531,17 @@ void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_str prs_align(ps); prs_uint32("switch_value ", ps, depth, &(q_n->switch_value)); + + return True; } /******************************************************************* makes a SRV_R_NET_SRV_GET_INFO structure. ********************************************************************/ -void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, +BOOL make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status) { - if (srv == NULL) return; + if (srv == NULL) return False; DEBUG(5,("make_srv_r_net_srv_get_info\n")); @@ -1447,14 +1559,16 @@ void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, } srv->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth) +BOOL srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth) { - if (r_n == NULL) return; + if (r_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_r_net_srv_get_info"); depth++; @@ -1464,26 +1578,30 @@ void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_str srv_io_info_ctr("ctr", r_n->ctr, ps, depth); prs_uint32("status ", ps, depth, &(r_n->status )); + + return True; } /******************************************************************* makes a SRV_Q_NET_REMOTE_TOD structure. ********************************************************************/ -void make_srv_q_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_t, char *server_name) +BOOL make_srv_q_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_t, char *server_name) { - if (q_t == NULL) return; + if (q_t == NULL) return False; DEBUG(5,("make_srv_q_net_remote_tod\n")); make_buf_unistr2(&(q_t->uni_srv_name), &(q_t->ptr_srv_name), server_name); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth) +BOOL srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth) { - if (q_n == NULL) return; + if (q_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_q_net_remote_tod"); depth++; @@ -1492,14 +1610,16 @@ void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct prs_uint32("ptr_srv_name ", ps, depth, &(q_n->ptr_srv_name)); smb_io_unistr2("", &(q_n->uni_srv_name), True, ps, depth); + + return True; } /******************************************************************* reads or writes a TIME_OF_DAY_INFO structure. ********************************************************************/ -static void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth) +static BOOL srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth) { - if (tod == NULL) return; + if (tod == NULL) return False; prs_debug(ps, depth, desc, "srv_io_time_of_day_info"); depth++; @@ -1519,17 +1639,19 @@ static void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_stru prs_uint32("year ", ps, depth, &(tod->year )); prs_uint32("weekday ", ps, depth, &(tod->weekday )); + + return True; } /******************************************************************* makes a TIME_OF_DAY_INFO structure. ********************************************************************/ -void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, +BOOL make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, uint32 hours, uint32 mins, uint32 secs, uint32 hunds, uint32 zone, uint32 tintervals, uint32 day, uint32 month, uint32 year, uint32 weekday) { - if (tod == NULL) return; + if (tod == NULL) return False; DEBUG(5,("make_time_of_day_info\n")); @@ -1545,15 +1667,17 @@ void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, tod->month = month; tod->year = year; tod->weekday = weekday; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth) +BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth) { - if (r_n == NULL) return; + if (r_n == NULL) return False; prs_debug(ps, depth, desc, "srv_io_r_net_remote_tod"); depth++; @@ -1565,4 +1689,6 @@ void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct * srv_io_time_of_day_info("tod", r_n->tod, ps, depth); prs_uint32("status ", ps, depth, &(r_n->status)); + + return True; } diff --git a/source3/rpc_parse/parse_svc.c b/source3/rpc_parse/parse_svc.c index f936df24b9..955d8df595 100644 --- a/source3/rpc_parse/parse_svc.c +++ b/source3/rpc_parse/parse_svc.c @@ -3,9 +3,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ extern int DEBUGLEVEL; /******************************************************************* make_svc_q_open_sc_man ********************************************************************/ -void make_svc_q_open_sc_man(SVC_Q_OPEN_SC_MAN *q_u, +BOOL make_svc_q_open_sc_man(SVC_Q_OPEN_SC_MAN *q_u, char *server, char *database, uint32 des_access) { @@ -40,14 +40,16 @@ void make_svc_q_open_sc_man(SVC_Q_OPEN_SC_MAN *q_u, make_buf_unistr2(&(q_u->uni_db_name ), &(q_u->ptr_db_name), database); q_u->des_access = des_access; + + return True; } /******************************************************************* reads or writes a SVC_Q_OPEN_SC_MAN structure. ********************************************************************/ -void svc_io_q_open_sc_man(char *desc, SVC_Q_OPEN_SC_MAN *q_u, prs_struct *ps, int depth) +BOOL svc_io_q_open_sc_man(char *desc, SVC_Q_OPEN_SC_MAN *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_open_sc_man"); depth++; @@ -64,26 +66,30 @@ void svc_io_q_open_sc_man(char *desc, SVC_Q_OPEN_SC_MAN *q_u, prs_struct *ps, in prs_uint32("des_access", ps, depth, &(q_u->des_access)); prs_align(ps); + + return True; } /******************************************************************* make_svc_r_open_sc_man ********************************************************************/ -void make_svc_r_open_sc_man(SVC_R_OPEN_SC_MAN *r_u, POLICY_HND *hnd, +BOOL make_svc_r_open_sc_man(SVC_R_OPEN_SC_MAN *r_u, POLICY_HND *hnd, uint32 status) { DEBUG(5,("make_svc_r_unknown_0: %d\n", __LINE__)); memcpy(&(r_u->pol), hnd, sizeof(r_u->pol)); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_r_open_sc_man(char *desc, SVC_R_OPEN_SC_MAN *r_u, prs_struct *ps, int depth) +BOOL svc_io_r_open_sc_man(char *desc, SVC_R_OPEN_SC_MAN *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_open_sc_man"); depth++; @@ -93,12 +99,14 @@ void svc_io_r_open_sc_man(char *desc, SVC_R_OPEN_SC_MAN *r_u, prs_struct *ps, i smb_io_pol_hnd("", &(r_u->pol), ps, depth); prs_uint32("status ", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* make_svc_q_open_service ********************************************************************/ -void make_svc_q_open_service(SVC_Q_OPEN_SERVICE *q_u, +BOOL make_svc_q_open_service(SVC_Q_OPEN_SERVICE *q_u, POLICY_HND *hnd, char *server, uint32 des_access) @@ -109,14 +117,16 @@ void make_svc_q_open_service(SVC_Q_OPEN_SERVICE *q_u, make_unistr2(&(q_u->uni_svc_name), server, strlen(server)+1); q_u->des_access = des_access; + + return True; } /******************************************************************* reads or writes a SVC_Q_OPEN_SERVICE structure. ********************************************************************/ -void svc_io_q_open_service(char *desc, SVC_Q_OPEN_SERVICE *q_u, prs_struct *ps, int depth) +BOOL svc_io_q_open_service(char *desc, SVC_Q_OPEN_SERVICE *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_open_service"); depth++; @@ -131,26 +141,30 @@ void svc_io_q_open_service(char *desc, SVC_Q_OPEN_SERVICE *q_u, prs_struct *ps, prs_uint32("des_access", ps, depth, &(q_u->des_access)); prs_align(ps); + + return True; } /******************************************************************* make_svc_r_open_service ********************************************************************/ -void make_svc_r_open_service(SVC_R_OPEN_SERVICE *r_u, POLICY_HND *hnd, +BOOL make_svc_r_open_service(SVC_R_OPEN_SERVICE *r_u, POLICY_HND *hnd, uint32 status) { DEBUG(5,("make_svc_r_unknown_0: %d\n", __LINE__)); memcpy(&(r_u->pol), hnd, sizeof(r_u->pol)); r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_r_open_service(char *desc, SVC_R_OPEN_SERVICE *r_u, prs_struct *ps, int depth) +BOOL svc_io_r_open_service(char *desc, SVC_R_OPEN_SERVICE *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_open_service"); depth++; @@ -160,14 +174,16 @@ void svc_io_r_open_service(char *desc, SVC_R_OPEN_SERVICE *r_u, prs_struct *ps, smb_io_pol_hnd("", &(r_u->pol), ps, depth); prs_uint32("status ", ps, depth, &(r_u->status)); + + return True; } /******************************************************************* reads or writes a SVC_Q_START_SERVICE structure. ********************************************************************/ -void svc_io_q_start_service(char *desc, SVC_Q_START_SERVICE *q_s, prs_struct *ps, int depth) +BOOL svc_io_q_start_service(char *desc, SVC_Q_START_SERVICE *q_s, prs_struct *ps, int depth) { - if (q_s == NULL) return; + if (q_s == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_start_service"); depth++; @@ -195,25 +211,29 @@ void svc_io_q_start_service(char *desc, SVC_Q_START_SERVICE *q_s, prs_struct *ps smb_io_unistr2("", &(q_s->argv[i]), 1, ps, depth); } } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_r_start_service(char *desc, SVC_R_START_SERVICE *r_s, prs_struct *ps, int depth) +BOOL svc_io_r_start_service(char *desc, SVC_R_START_SERVICE *r_s, prs_struct *ps, int depth) { - if (r_s == NULL) return; + if (r_s == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_start_service"); depth++; prs_uint32("status", ps, depth, &(r_s->status)); + + return True; } /******************************************************************* make_svc_query_svc_cfg ********************************************************************/ -void make_svc_query_svc_cfg(QUERY_SERVICE_CONFIG *q_u, +BOOL make_svc_query_svc_cfg(QUERY_SERVICE_CONFIG *q_u, uint32 service_type, uint32 start_type, uint32 error_control, char* bin_path_name, char* load_order_grp, @@ -232,14 +252,16 @@ void make_svc_query_svc_cfg(QUERY_SERVICE_CONFIG *q_u, make_buf_unistr2(&(q_u->uni_dependencies ), &(q_u->ptr_dependencies ), dependencies ); make_buf_unistr2(&(q_u->uni_service_start_name), &(q_u->ptr_service_start_name), service_start_name); make_buf_unistr2(&(q_u->uni_display_name ), &(q_u->ptr_display_name ), disp_name ); + + return True; } /******************************************************************* reads or writes a QUERY_SERVICE_CONFIG structure. ********************************************************************/ -void svc_io_query_svc_cfg(char *desc, QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, int depth) +BOOL svc_io_query_svc_cfg(char *desc, QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_query_svc_cfg"); depth++; @@ -266,16 +288,18 @@ void svc_io_query_svc_cfg(char *desc, QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, prs_align(ps); smb_io_unistr2("uni_display_name ", &(q_u->uni_display_name ), q_u->ptr_display_name , ps, depth); prs_align(ps); + + return True; } /******************************************************************* makes an SVC_Q_ENUM_SVCS_STATUS structure. ********************************************************************/ -void make_svc_q_enum_svcs_status(SVC_Q_ENUM_SVCS_STATUS *q_c, POLICY_HND *hnd, +BOOL make_svc_q_enum_svcs_status(SVC_Q_ENUM_SVCS_STATUS *q_c, POLICY_HND *hnd, uint32 service_type, uint32 service_state, uint32 buf_size, uint32 resume_hnd ) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_svc_q_enum_svcs_status\n")); @@ -284,14 +308,16 @@ void make_svc_q_enum_svcs_status(SVC_Q_ENUM_SVCS_STATUS *q_c, POLICY_HND *hnd, q_c->service_state = service_state; q_c->buf_size = buf_size; make_enum_hnd(&q_c->resume_hnd, resume_hnd); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_q_enum_svcs_status(char *desc, SVC_Q_ENUM_SVCS_STATUS *q_u, prs_struct *ps, int depth) +BOOL svc_io_q_enum_svcs_status(char *desc, SVC_Q_ENUM_SVCS_STATUS *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_enum_svcs_status"); depth++; @@ -305,17 +331,19 @@ void svc_io_q_enum_svcs_status(char *desc, SVC_Q_ENUM_SVCS_STATUS *q_u, prs_str prs_uint32("service_state", ps, depth, &(q_u->service_state)); prs_uint32("buf_size ", ps, depth, &(q_u->buf_size )); smb_io_enum_hnd("resume_hnd", &(q_u->resume_hnd), ps, depth); + + return True; } /******************************************************************* makes an SVC_R_ENUM_SVCS_STATUS structure. ********************************************************************/ -void make_svc_r_enum_svcs_status(SVC_R_ENUM_SVCS_STATUS *r_c, +BOOL make_svc_r_enum_svcs_status(SVC_R_ENUM_SVCS_STATUS *r_c, ENUM_SRVC_STATUS *svcs, uint32 more_buf_size, uint32 num_svcs, uint32 resume_hnd, uint32 dos_status) { - if (r_c == NULL) return; + if (r_c == NULL) return False; DEBUG(5,("make_svc_r_enum_svcs_status\n")); @@ -324,6 +352,8 @@ void make_svc_r_enum_svcs_status(SVC_R_ENUM_SVCS_STATUS *r_c, r_c->num_svcs = num_svcs; make_enum_hnd(&r_c->resume_hnd, resume_hnd); r_c->dos_status = dos_status; + + return True; } /******************************************************************* @@ -334,10 +364,10 @@ not COMMUNICATE and get some CONSISTENCY TO THEIR DATA STRUCTURES! ARGH! ********************************************************************/ -void svc_io_r_enum_svcs_status(char *desc, SVC_R_ENUM_SVCS_STATUS *svc, prs_struct *ps, int depth) +BOOL svc_io_r_enum_svcs_status(char *desc, SVC_R_ENUM_SVCS_STATUS *svc, prs_struct *ps, int depth) { int i; - if (svc == NULL) return; + if (svc == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_enum_svcs_status"); depth++; @@ -380,7 +410,7 @@ void svc_io_r_enum_svcs_status(char *desc, SVC_R_ENUM_SVCS_STATUS *svc, prs_stru { DEBUG(0,("svc_io_r_enum_svcs_status: Realloc failed\n")); ps->offset = 0x7fffffff; - return; + return False; } bzero(svc->svcs, svc->num_svcs * sizeof(ENUM_SRVC_STATUS)); @@ -426,7 +456,7 @@ void svc_io_r_enum_svcs_status(char *desc, SVC_R_ENUM_SVCS_STATUS *svc, prs_stru if (svc->svcs == NULL) { - return; + return False; } for (i = 0; i < svc->num_svcs; i++) @@ -482,14 +512,16 @@ void svc_io_r_enum_svcs_status(char *desc, SVC_R_ENUM_SVCS_STATUS *svc, prs_stru smb_io_enum_hnd("resume_hnd", &(svc->resume_hnd), ps, depth); prs_uint32("dos_status", ps, depth, &(svc->dos_status)); } + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_svc_status(char *desc, SVC_STATUS *svc, prs_struct *ps, int depth) +BOOL svc_io_svc_status(char *desc, SVC_STATUS *svc, prs_struct *ps, int depth) { - if (svc == NULL) return; + if (svc == NULL) return False; prs_debug(ps, depth, desc, "svc_io_svc_status"); depth++; @@ -503,28 +535,32 @@ void svc_io_svc_status(char *desc, SVC_STATUS *svc, prs_struct *ps, int depth) prs_uint32("svc_specific_exit_code", ps, depth, &(svc->svc_specific_exit_code)); prs_uint32("check_point", ps, depth, &(svc->check_point)); prs_uint32("wait_hint", ps, depth, &(svc->wait_hint)); + + return True; } /******************************************************************* makes an SVC_Q_QUERY_SVC_CONFIG structure. ********************************************************************/ -void make_svc_q_query_svc_config(SVC_Q_QUERY_SVC_CONFIG *q_c, POLICY_HND *hnd, +BOOL make_svc_q_query_svc_config(SVC_Q_QUERY_SVC_CONFIG *q_c, POLICY_HND *hnd, uint32 buf_size) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_svc_q_query_svc_config\n")); memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); q_c->buf_size = buf_size; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_q_query_svc_config(char *desc, SVC_Q_QUERY_SVC_CONFIG *q_u, prs_struct *ps, int depth) +BOOL svc_io_q_query_svc_config(char *desc, SVC_Q_QUERY_SVC_CONFIG *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_query_svc_config"); depth++; @@ -534,29 +570,33 @@ void svc_io_q_query_svc_config(char *desc, SVC_Q_QUERY_SVC_CONFIG *q_u, prs_str smb_io_pol_hnd("", &(q_u->pol), ps, depth); prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* makes an SVC_R_QUERY_SVC_CONFIG structure. ********************************************************************/ -void make_svc_r_query_svc_config(SVC_R_QUERY_SVC_CONFIG *r_c, +BOOL make_svc_r_query_svc_config(SVC_R_QUERY_SVC_CONFIG *r_c, QUERY_SERVICE_CONFIG *cfg, uint32 buf_size) { - if (r_c == NULL) return; + if (r_c == NULL) return False; DEBUG(5,("make_svc_r_query_svc_config\n")); r_c->cfg = cfg; r_c->buf_size = buf_size; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_struct *ps, int depth) +BOOL svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_query_svc_config"); depth++; @@ -566,14 +606,16 @@ void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_str svc_io_query_svc_cfg("cfg", r_u->cfg, ps, depth); prs_uint32("buf_size", ps, depth, &(r_u->buf_size)); prs_uint32("status ", ps, depth, &(r_u->status )); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct *ps, int depth) +BOOL svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_query_disp_name"); depth++; @@ -587,17 +629,19 @@ void svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct prs_align(ps); prs_uint32("buf_size", ps, depth, &(q_u->buf_size)); + + return True; } /******************************************************************* makes an SVC_R_QUERY_DISP_NAME structure. ********************************************************************/ -void make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d, +BOOL make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d, char *disp_name, uint32 status) { uint32 len = strlen(disp_name); - if (r_d == NULL) return; + if (r_d == NULL) return False; DEBUG(5,("make_svc_r_query_disp_name\n")); @@ -605,14 +649,16 @@ void make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d, r_d->buf_size = len; r_d->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct *ps, int depth) +BOOL svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_query_disp_name"); depth++; @@ -624,26 +670,30 @@ void svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct prs_uint32("buf_size", ps, depth, &(r_u->buf_size)); prs_uint32("status ", ps, depth, &(r_u->status )); + + return True; } /******************************************************************* makes an SVC_Q_CLOSE structure. ********************************************************************/ -void make_svc_q_close(SVC_Q_CLOSE *q_c, POLICY_HND *hnd) +BOOL make_svc_q_close(SVC_Q_CLOSE *q_c, POLICY_HND *hnd) { - if (q_c == NULL || hnd == NULL) return; + if (q_c == NULL || hnd == NULL) return False; DEBUG(5,("make_svc_q_close\n")); memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_q_close(char *desc, SVC_Q_CLOSE *q_u, prs_struct *ps, int depth) +BOOL svc_io_q_close(char *desc, SVC_Q_CLOSE *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_q_close"); depth++; @@ -652,14 +702,16 @@ void svc_io_q_close(char *desc, SVC_Q_CLOSE *q_u, prs_struct *ps, int depth) smb_io_pol_hnd("", &(q_u->pol), ps, depth); prs_align(ps); + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void svc_io_r_close(char *desc, SVC_R_CLOSE *r_u, prs_struct *ps, int depth) +BOOL svc_io_r_close(char *desc, SVC_R_CLOSE *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "svc_io_r_close"); depth++; @@ -670,5 +722,7 @@ void svc_io_r_close(char *desc, SVC_R_CLOSE *r_u, prs_struct *ps, int depth) prs_align(ps); prs_uint32("status", ps, depth, &(r_u->status)); + + return True; } diff --git a/source3/rpc_parse/parse_wks.c b/source3/rpc_parse/parse_wks.c index 2386fa6636..91409e2eec 100644 --- a/source3/rpc_parse/parse_wks.c +++ b/source3/rpc_parse/parse_wks.c @@ -3,9 +3,9 @@ * Unix SMB/Netbios implementation. * Version 1.9. * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997. + * Copyright (C) Andrew Tridgell 1992-1999, + * Copyright (C) Luke Kenneth Casson Leighton 1996-1999, + * Copyright (C) Paul Ashton 1997-1999. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ extern int DEBUGLEVEL; /******************************************************************* make_wks_q_query_info ********************************************************************/ -void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, +BOOL make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, char *server, uint16 switch_value) { DEBUG(5,("make_wks_q_query_info\n")); @@ -38,14 +38,16 @@ void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, make_buf_unistr2(&(q_u->uni_srv_name), &(q_u->ptr_srv_name), server); q_u->switch_value = switch_value; + + return True; } /******************************************************************* reads or writes a WKS_Q_QUERY_INFO structure. ********************************************************************/ -void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth) +BOOL wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth) { - if (q_u == NULL) return; + if (q_u == NULL) return False; prs_debug(ps, depth, desc, "wks_io_q_query_info"); depth++; @@ -58,12 +60,14 @@ void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int prs_uint16("switch_value", ps, depth, &(q_u->switch_value)); prs_align(ps); + + return True; } /******************************************************************* wks_info_100 ********************************************************************/ -void make_wks_info_100(WKS_INFO_100 *inf, +BOOL make_wks_info_100(WKS_INFO_100 *inf, uint32 platform_id, uint32 ver_major, uint32 ver_minor, char *my_name, char *domain_name) { @@ -75,14 +79,16 @@ void make_wks_info_100(WKS_INFO_100 *inf, make_buf_unistr2(&(inf->uni_compname), &(inf->ptr_compname), my_name ); make_buf_unistr2(&(inf->uni_lan_grp ), &(inf->ptr_lan_grp ), domain_name); + + return True; } /******************************************************************* reads or writes a WKS_INFO_100 structure. ********************************************************************/ -static void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth) +static BOOL wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth) { - if (inf == NULL) return; + if (inf == NULL) return False; prs_debug(ps, depth, desc, "wks_io_wks_info_100"); depth++; @@ -100,6 +106,8 @@ static void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, i smb_io_unistr2("", &(inf->uni_lan_grp ), inf->ptr_lan_grp , ps, depth); prs_align(ps); + + return True; } /******************************************************************* @@ -108,7 +116,7 @@ static void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, i only supports info level 100 at the moment. ********************************************************************/ -void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, +BOOL make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, uint32 switch_value, WKS_INFO_100 *wks100, int status) { @@ -120,14 +128,16 @@ void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, r_u->wks100 = wks100; r_u->status = status; + + return True; } /******************************************************************* reads or writes a structure. ********************************************************************/ -void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth) +BOOL wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth) { - if (r_u == NULL) return; + if (r_u == NULL) return False; prs_debug(ps, depth, desc, "wks_io_r_query_info"); depth++; @@ -141,5 +151,7 @@ void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int wks_io_wks_info_100("inf", r_u->wks100, ps, depth); prs_uint32("status ", ps, depth, &(r_u->status)); + + return True; } |