diff options
author | Gerald Carter <jerry@samba.org> | 2002-03-26 03:15:30 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-03-26 03:15:30 +0000 |
commit | 737423f06ea08c38592b408faa12a55a95b9d696 (patch) | |
tree | b4d9d1ffba0516040a46766f83dfa7ef17d8cc3c /source3/rpc_parse | |
parent | 8f9d7ebb35f40ab6bda8f1d6d940df8b6aec4126 (diff) | |
download | samba-737423f06ea08c38592b408faa12a55a95b9d696.tar.gz samba-737423f06ea08c38592b408faa12a55a95b9d696.tar.bz2 samba-737423f06ea08c38592b408faa12a55a95b9d696.zip |
OpenPrinter() merge from 2.2
(This used to be commit 619397cc90549d4602ecddc25ee50eb247c913ee)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 95 |
1 files changed, 76 insertions, 19 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 97e2020a3e..5c2dd6b48f 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -880,12 +880,12 @@ BOOL make_spoolss_printer_info_2(TALLOC_CTX *mem_ctx, SPOOL_PRINTER_INFO_LEVEL_2 * called from spoolss_q_open_printer_ex (srv_spoolss.c) ********************************************************************/ -BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *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 False; - prs_debug(ps, depth, desc, "spoolss_io_q_open_printer_ex"); + prs_debug(ps, depth, desc, "spoolss_io_q_open_printer"); depth++; if (!prs_align(ps)) @@ -902,35 +902,66 @@ BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_ if (!spoolss_io_printer_default("", &q_u->printer_default, ps, depth)) return False; - if (!prs_uint32("user_switch", ps, depth, &q_u->user_switch)) + return True; +} + +/******************************************************************* + * write a structure. + * called from static spoolss_r_open_printer_ex (srv_spoolss.c) + * called from spoolss_open_printer_ex (cli_spoolss.c) + ********************************************************************/ + +BOOL spoolss_io_r_open_printer(char *desc, SPOOL_R_OPEN_PRINTER *r_u, prs_struct *ps, int depth) +{ + if (r_u == NULL) return False; + + prs_debug(ps, depth, desc, "spoolss_io_r_open_printer"); + depth++; + + if (!prs_align(ps)) + return False; + + if (!smb_io_pol_hnd("printer handle",&(r_u->handle),ps,depth)) return False; - if (!spool_io_user_level("", &q_u->user_ctr, ps, depth)) + + if (!prs_werror("status code", ps, depth, &(r_u->status))) return False; return True; } + /******************************************************************* - * init a structure. + * read a structure. + * called from spoolss_q_open_printer_ex (srv_spoolss.c) ********************************************************************/ -BOOL make_spoolss_q_deleteprinterdriver( - TALLOC_CTX *mem_ctx, - SPOOL_Q_DELETEPRINTERDRIVER *q_u, - const char *server, - const char* arch, - const char* driver -) + +BOOL spoolss_io_q_open_printer_ex(char *desc, SPOOL_Q_OPEN_PRINTER_EX *q_u, prs_struct *ps, int depth) { - DEBUG(5,("make_spoolss_q_deleteprinterdriver\n")); + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "spoolss_io_q_open_printer_ex"); + depth++; + + if (!prs_align(ps)) + return False; + + if (!prs_uint32("printername_ptr", ps, depth, &q_u->printername_ptr)) + return False; + if (!smb_io_unistr2("", &q_u->printername, q_u->printername_ptr, ps,depth)) + return False; - q_u->server_ptr = (server!=NULL)?1:0; + if (!prs_align(ps)) + return False; - /* these must be NULL terminated or else NT4 will - complain about invalid parameters --jerry */ - init_unistr2(&q_u->server, server, strlen(server)+1); - init_unistr2(&q_u->arch, arch, strlen(arch)+1); - init_unistr2(&q_u->driver, driver, strlen(driver)+1); + if (!spoolss_io_printer_default("", &q_u->printer_default, ps, depth)) + return False; + if (!prs_uint32("user_switch", ps, depth, &q_u->user_switch)) + return False; + if (!spool_io_user_level("", &q_u->user_ctr, ps, depth)) + return False; return True; } @@ -961,6 +992,32 @@ BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_ } /******************************************************************* + * init a structure. + ********************************************************************/ +BOOL make_spoolss_q_deleteprinterdriver( + TALLOC_CTX *mem_ctx, + SPOOL_Q_DELETEPRINTERDRIVER *q_u, + const char *server, + const char* arch, + const char* driver +) +{ + DEBUG(5,("make_spoolss_q_deleteprinterdriver\n")); + + q_u->server_ptr = (server!=NULL)?1:0; + + /* these must be NULL terminated or else NT4 will + complain about invalid parameters --jerry */ + init_unistr2(&q_u->server, server, strlen(server)+1); + init_unistr2(&q_u->arch, arch, strlen(arch)+1); + init_unistr2(&q_u->driver, driver, strlen(driver)+1); + + + return True; +} + + +/******************************************************************* * make a structure. ********************************************************************/ |