diff options
author | Jeremy Allison <jra@samba.org> | 2000-08-30 00:45:59 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-08-30 00:45:59 +0000 |
commit | d407579b94ee2647d1e51c536534024e5c4c51ad (patch) | |
tree | c4a3ae28143ea3bfc4fe11022455b3d85f94c321 /source3/rpc_server/srv_spoolss_nt.c | |
parent | 3b33053b886b88bb7546f77dcdb038fcdc501c6c (diff) | |
download | samba-d407579b94ee2647d1e51c536534024e5c4c51ad.tar.gz samba-d407579b94ee2647d1e51c536534024e5c4c51ad.tar.bz2 samba-d407579b94ee2647d1e51c536534024e5c4c51ad.zip |
Implemented AbortPrinter() from Gerald's Win32 test code. Just purge all
possible printjobs from that printer (I think this is correct).
Added error code returns for print_queue_XXX() functions.
Jeremy.
(This used to be commit 6d081a9017f87f59b7189ba507e211db01c40af5)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index b118b7c933..b9266c7ee1 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2999,6 +2999,7 @@ static uint32 control_printer(POLICY_HND *handle, uint32 command, { struct current_user user; int snum; + int errcode = 0; Printer_entry *Printer = find_printer_index_by_hnd(handle); if (p->ntlmssp_auth_validated) { @@ -3018,27 +3019,39 @@ static uint32 control_printer(POLICY_HND *handle, uint32 command, switch (command) { case PRINTER_CONTROL_PAUSE: - if (print_queue_pause(&user, snum)) { + if (print_queue_pause(&user, snum, &errcode)) { return 0; } break; case PRINTER_CONTROL_RESUME: case PRINTER_CONTROL_UNPAUSE: - if (print_queue_resume(&user, snum)) { + if (print_queue_resume(&user, snum, &errcode)) { return 0; } break; case PRINTER_CONTROL_PURGE: - if (print_queue_purge(&user, snum)) { + if (print_queue_purge(&user, snum, &errcode)) { return 0; } break; } + if (errcode) + return (uint32)errcode; + return ERROR_INVALID_FUNCTION; } /******************************************************************** + * api_spoolss_abortprinter + ********************************************************************/ + +uint32 _spoolss_abortprinter(POLICY_HND *handle, pipes_struct *p) +{ + return control_printer(handle, PRINTER_CONTROL_PURGE, p); +} + +/******************************************************************** * called by spoolss_api_setprinter * when updating a printer description ********************************************************************/ |