diff options
author | Günther Deschner <gd@samba.org> | 2009-06-23 20:26:27 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-06-24 00:36:11 +0200 |
commit | 118ac25784dba37e135ed427ab347107bf8fc8e9 (patch) | |
tree | 780c910f6ce05c5447614e2c49d835e1e608cffa /source3/rpc_server | |
parent | a6ab195d72ab5b986f278662f1fbbb5d983effec (diff) | |
download | samba-118ac25784dba37e135ed427ab347107bf8fc8e9.tar.gz samba-118ac25784dba37e135ed427ab347107bf8fc8e9.tar.bz2 samba-118ac25784dba37e135ed427ab347107bf8fc8e9.zip |
s3-spoolss: restructure _spoolss_EndDocPrinter().
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index f71099434b..899fed2167 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -1995,31 +1995,6 @@ static bool convert_printer_driver_info(const struct spoolss_AddDriverInfoCtr *r return true; } -/******************************************************************** - * _spoolss_enddocprinter_internal. - ********************************************************************/ - -static WERROR _spoolss_enddocprinter_internal(pipes_struct *p, - struct policy_handle *handle) -{ - Printer_entry *Printer = find_printer_index_by_hnd(p, handle); - int snum; - - if (!Printer) { - DEBUG(2,("_spoolss_enddocprinter_internal: Invalid handle (%s:%u:%u)\n", OUR_HANDLE(handle))); - return WERR_BADFID; - } - - if (!get_printer_snum(p, handle, &snum, NULL)) - return WERR_BADFID; - - Printer->document_started = false; - print_job_end(snum, Printer->jobid,NORMAL_CLOSE); - /* error codes unhandled so far ... */ - - return WERR_OK; -} - /**************************************************************** _spoolss_ClosePrinter ****************************************************************/ @@ -2029,8 +2004,13 @@ WERROR _spoolss_ClosePrinter(pipes_struct *p, { Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle); - if (Printer && Printer->document_started) - _spoolss_enddocprinter_internal(p, r->in.handle); /* print job was not closed */ + if (Printer && Printer->document_started) { + struct spoolss_EndDocPrinter e; + + e.in.handle = r->in.handle; + + _spoolss_EndDocPrinter(p, &e); + } if (!close_printer_handle(p, r->in.handle)) return WERR_BADFID; @@ -2055,8 +2035,13 @@ WERROR _spoolss_DeletePrinter(pipes_struct *p, Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle); WERROR result; - if (Printer && Printer->document_started) - _spoolss_enddocprinter_internal(p, r->in.handle); /* print job was not closed */ + if (Printer && Printer->document_started) { + struct spoolss_EndDocPrinter e; + + e.in.handle = r->in.handle; + + _spoolss_EndDocPrinter(p, &e); + } result = delete_printer_handle(p, r->in.handle); @@ -5659,7 +5644,24 @@ WERROR _spoolss_StartDocPrinter(pipes_struct *p, WERROR _spoolss_EndDocPrinter(pipes_struct *p, struct spoolss_EndDocPrinter *r) { - return _spoolss_enddocprinter_internal(p, r->in.handle); + Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle); + int snum; + + if (!Printer) { + DEBUG(2,("_spoolss_EndDocPrinter: Invalid handle (%s:%u:%u)\n", + OUR_HANDLE(r->in.handle))); + return WERR_BADFID; + } + + if (!get_printer_snum(p, r->in.handle, &snum, NULL)) { + return WERR_BADFID; + } + + Printer->document_started = false; + print_job_end(snum, Printer->jobid, NORMAL_CLOSE); + /* error codes unhandled so far ... */ + + return WERR_OK; } /**************************************************************** |